Patch patch_closures_rebind for Scripting Engine problem Bug #52539
Patch version 2010-08-08 14:30 UTC
Return to Bug #52539 |
Download this patch
Patch Revisions:
Developer: cataphract@php.net
Index: Zend/zend_closures.c
===================================================================
--- Zend/zend_closures.c (revision 301984)
+++ Zend/zend_closures.c (working copy)
@@ -409,14 +409,7 @@
closure->func = *func;
if (closure->func.type == ZEND_USER_FUNCTION) {
- if (closure->func.op_array.static_variables) {
- HashTable *static_variables = closure->func.op_array.static_variables;
-
- ALLOC_HASHTABLE(closure->func.op_array.static_variables);
- zend_hash_init(closure->func.op_array.static_variables, zend_hash_num_elements(static_variables), NULL, ZVAL_PTR_DTOR, 0);
- zend_hash_apply_with_arguments(static_variables TSRMLS_CC, (apply_func_args_t)zval_copy_static_var, 1, closure->func.op_array.static_variables);
- }
- (*closure->func.op_array.refcount)++;
+ function_add_ref(&closure->func);
} else {
/* verify that we aren't binding internal function to a wrong scope */
if(func->common.scope != NULL) {
|