From: Zeev Suraski Date: Mon, 3 Jan 2000 20:01:54 +0000 (+0000) Subject: Fix a bug when using [] on a string X-Git-Tag: BEFORE_PRE_SHUTDOWN_REVERSE_PATCH~75 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f29ee8f7ee7508e01ba7f22214b714528d6fe363;p=php Fix a bug when using [] on a string --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 6e78261129..0f8e602f65 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -715,6 +715,10 @@ static inline void zend_fetch_dimension_address(znode *result, znode *op1, znode zval *offset; zval tmp; + if (op2->op_type==IS_UNUSED) { + zend_error(E_ERROR, "[] operator not supported for strings"); + } + offset = get_zval_ptr(op2, Ts, &free_op2, BP_VAR_R); if (offset->type != IS_LONG) {