Index: ext/spl/php_spl.c =================================================================== RCS file: /repository/php-src/ext/spl/php_spl.c,v retrieving revision 1.52.2.28.2.17.2.35 diff -u -p -r1.52.2.28.2.17.2.35 php_spl.c --- ext/spl/php_spl.c 26 Jan 2009 11:38:03 -0000 1.52.2.28.2.17.2.35 +++ ext/spl/php_spl.c 20 Apr 2009 14:11:17 -0000 @@ -353,6 +353,7 @@ PHP_FUNCTION(spl_autoload_extensions) typedef struct { zend_function *func_ptr; zval *obj; + zval *closure; zend_class_entry *ce; } autoload_func_info; @@ -361,6 +362,9 @@ static void autoload_func_info_dtor(auto if (alfi->obj) { zval_ptr_dtor(&alfi->obj); } + if (alfi->closure) { + zval_ptr_dtor(&alfi->closure); + } } /* {{{ proto void spl_autoload_call(string class_name) @@ -488,9 +492,14 @@ PHP_FUNCTION(spl_autoload_register) RETURN_FALSE; } } + alfi.closure = NULL; alfi.ce = fcc.calling_scope; alfi.func_ptr = fcc.function_handler; obj_ptr = fcc.object_ptr; + if (Z_TYPE_P(zcallable) == IS_OBJECT) { + alfi.closure = zcallable; + Z_ADDREF_P(zcallable); + } if (error) { efree(error); } @@ -527,6 +536,7 @@ PHP_FUNCTION(spl_autoload_register) spl_alfi.func_ptr = spl_func_ptr; spl_alfi.obj = NULL; spl_alfi.ce = NULL; + spl_alfi.closure = NULL; zend_hash_add(SPL_G(autoload_functions), "spl_autoload", sizeof("spl_autoload"), &spl_alfi, sizeof(autoload_func_info), NULL); if (prepend && SPL_G(autoload_functions)->nNumOfElements > 1) { /* Move the newly created element to the head of the hashtable */