]> granicus.if.org Git - php/commitdiff
Allow var $foo = array(ABC => 1) constructs
authorStanislav Malyshev <stas@php.net>
Thu, 7 Dec 2000 10:36:10 +0000 (10:36 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 7 Dec 2000 10:36:10 +0000 (10:36 +0000)
# It still doesn't work good with constants, but at least doesn't leak now

Zend/zend_compile.c

index c975e5c88ac774893ecd0296ed4b64e301b6db8b..f7a6d56c605f2b7a556aeba21657615242426c08 100644 (file)
@@ -1791,6 +1791,7 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
        *element = expr->u.constant;
        if (offset) {
                switch (offset->u.constant.type) {
+                   case IS_CONSTANT:
                        case IS_STRING:
                                zend_hash_update(result->u.constant.value.ht, offset->u.constant.value.str.val, offset->u.constant.value.str.len+1, &element, sizeof(zval *), NULL);
                                zval_dtor(&offset->u.constant);