php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52539
Patch patch_closures_rebind revision 2010-08-08 14:30 UTC by cataphract@php.net

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) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 04:01:30 2024 UTC