]> granicus.if.org Git - php/commitdiff
Fix a bug when using [] on a string
authorZeev Suraski <zeev@php.net>
Mon, 3 Jan 2000 20:01:54 +0000 (20:01 +0000)
committerZeev Suraski <zeev@php.net>
Mon, 3 Jan 2000 20:01:54 +0000 (20:01 +0000)
Zend/zend_execute.c

index 6e7826112930ab6bfc01e292209a4c4df5d18472..0f8e602f6547104a97da45640f9fa738ce2033f3 100644 (file)
@@ -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) {