summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>1999-12-24 16:03:44 +0000
committerZeev Suraski <zeev@php.net>1999-12-24 16:03:44 +0000
commite28aff2f7aa02824142bf425b65c74b0bcd9622a (patch)
tree2ba3b83680b2934c6750d655fd7f06f148217190
parentfc6c531ec27b8cf9002ead53707b1626e8c31f74 (diff)
downloadphp-git-e28aff2f7aa02824142bf425b65c74b0bcd9622a.tar.gz
Optimize
-rw-r--r--Zend/zend_compile.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index ac20dfce94..473cadbfac 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -1034,14 +1034,15 @@ ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_tabl
case ZEND_DECLARE_FUNCTION: {
zend_function *function;
- zend_hash_find(function_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void **) &function);
- if (zend_hash_add(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, function, sizeof(zend_function), (void **) &function)==FAILURE) {
+ zend_hash_find(function_table, opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, (void *) &function);
+ if (zend_hash_add(function_table, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len+1, function, sizeof(zend_function), NULL)==FAILURE) {
if (!compile_time) {
zend_error(E_ERROR, "Cannot redeclare %s()", opline->op2.u.constant.value.str.val);
}
return FAILURE;
} else {
- function_add_ref(function);
+ (*function->op_array.refcount)++;
+ function->op_array.static_variables = NULL; /* NULL out the unbound function */
return SUCCESS;
}
}