From: Stanislav Malyshev Date: Thu, 7 Dec 2000 10:36:10 +0000 (+0000) Subject: Allow var $foo = array(ABC => 1) constructs X-Git-Tag: php-4.0.5RC1~982 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8ba3eeabd9e0fb6246e349ade6f162cab7c2e6de;p=php Allow var $foo = array(ABC => 1) constructs # It still doesn't work good with constants, but at least doesn't leak now --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c975e5c88a..f7a6d56c60 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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);