diff options
author | Stanislav Malyshev <stas@php.net> | 2002-09-10 08:35:50 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2002-09-10 08:35:50 +0000 |
commit | ca6717e348434fef43ba4963dcec10b43a2bc487 (patch) | |
tree | 5ef21136c7b61f3a1183438e2e61420626a4f9d0 | |
parent | 7fca47f1cf759edf8f94868f21a5ee5167451cad (diff) | |
download | php-git-ca6717e348434fef43ba4963dcec10b43a2bc487.tar.gz |
MFZE1
-rw-r--r-- | Zend/zend_execute_API.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 03a8304cd9..a1d30cb15b 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -415,6 +415,16 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC) zend_hash_move_forward(p->value.ht); continue; } + + if(const_value.type == IS_STRING && + const_value.value.str.len == str_index_len-1 && + !strncmp(const_value.value.str.val, str_index, str_index_len)) { + /* constant value is the same as its name */ + zval_dtor(&const_value); + zend_hash_move_forward(p->value.ht); + continue; + } + switch (const_value.type) { case IS_STRING: zend_hash_update(p->value.ht, const_value.value.str.val, const_value.value.str.len+1, element, sizeof(zval *), NULL); @@ -426,6 +436,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC) break; } zend_hash_del(p->value.ht, str_index, str_index_len); + zval_dtor(&const_value); } zend_hash_apply_with_argument(p->value.ht, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); } |