if (!zend_is_callable(shutdown_function_entry->arguments[0], 0, &function_name)) {
php_error(E_WARNING, "(Registered shutdown functions) Unable to call %R() - function does not exist", Z_TYPE(function_name), Z_UNIVAL(function_name));
- } else if (call_user_function(EG(function_table), NULL,
- shutdown_function_entry->arguments[0],
- &retval,
- shutdown_function_entry->arg_count - 1,
- shutdown_function_entry->arguments + 1
- TSRMLS_CC ) == SUCCESS)
+ zval_dtor(&function_name);
+ return 0;
+ }
+ zval_dtor(&function_name);
+
+ if (call_user_function(EG(function_table), NULL,
+ shutdown_function_entry->arguments[0],
+ &retval,
+ shutdown_function_entry->arg_count - 1,
+ shutdown_function_entry->arguments + 1
+ TSRMLS_CC ) == SUCCESS)
{
zval_dtor(&retval);
}
- zval_dtor(&function_name);
return 0;
}
--- /dev/null
+--TEST--
+register_shutdown_function() & __call
+--FILE--
+<?php
+class test {
+ function _foo() {
+ throw new Exception('test');
+ }
+ function __call($name=null, $args=null) {
+ return test::_foo();
+ }
+}
+
+var_dump(register_shutdown_function(array("test","__call")));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Strict Standards: Non-static method test::__call() cannot be called statically in %s on line %d
+NULL
+Done
+
+Strict Standards: Non-static method test::__call() cannot be called statically in Unknown on line 0
+
+Fatal error: Non-static method test::__call() cannot be called statically in Unknown on line 0