summaryrefslogtreecommitdiff
path: root/ext/spl/php_spl.c
diff options
context:
space:
mode:
authorHannes Magnusson <bjori@php.net>2009-07-28 22:25:31 +0000
committerHannes Magnusson <bjori@php.net>2009-07-28 22:25:31 +0000
commit650ece0b75eea20af812f3a4208bbf0534eb2273 (patch)
tree0f4ba28f7bcff43b20ecdd7e22731e106760cc44 /ext/spl/php_spl.c
parent18d7a1b4615df80d4ead88e606c7cc5be52ec635 (diff)
downloadphp-git-650ece0b75eea20af812f3a4208bbf0534eb2273.tar.gz
MFH: Fixed bug #44144 & add test
Diffstat (limited to 'ext/spl/php_spl.c')
-rwxr-xr-xext/spl/php_spl.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index eddb16f041..2d2cdb5aac 100755
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -564,8 +564,9 @@ PHP_FUNCTION(spl_autoload_unregister)
Return all registered __autoload() functionns */
PHP_FUNCTION(spl_autoload_functions)
{
- zend_function *fptr, **func_ptr_ptr;
+ zend_function *fptr;
HashPosition function_pos;
+ autoload_func_info *alfi;
if (!EG(autoload_func)) {
if (zend_hash_find(EG(function_table), ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME), (void **) &fptr) == SUCCESS) {
@@ -582,17 +583,22 @@ PHP_FUNCTION(spl_autoload_functions)
array_init(return_value);
zend_hash_internal_pointer_reset_ex(SPL_G(autoload_functions), &function_pos);
while(zend_hash_has_more_elements_ex(SPL_G(autoload_functions), &function_pos) == SUCCESS) {
- zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) &func_ptr_ptr, &function_pos);
- if ((*func_ptr_ptr)->common.scope) {
+ zend_hash_get_current_data_ex(SPL_G(autoload_functions), (void **) &alfi, &function_pos);
+ if (alfi->func_ptr->common.scope) {
zval *tmp;
MAKE_STD_ZVAL(tmp);
array_init(tmp);
- add_next_index_string(tmp, (*func_ptr_ptr)->common.scope->name, 1);
- add_next_index_string(tmp, (*func_ptr_ptr)->common.function_name, 1);
+ if (alfi->obj) {
+ alfi->obj->refcount++;
+ add_next_index_zval(tmp, alfi->obj);
+ } else {
+ add_next_index_string(tmp, alfi->ce->name, 1);
+ }
+ add_next_index_string(tmp, alfi->func_ptr->common.function_name, 1);
add_next_index_zval(return_value, tmp);
} else
- add_next_index_string(return_value, (*func_ptr_ptr)->common.function_name, 1);
+ add_next_index_string(return_value, alfi->func_ptr->common.function_name, 1);
zend_hash_move_forward_ex(SPL_G(autoload_functions), &function_pos);
}