diff options
author | Dmitry Stogov <dmitry@php.net> | 2008-07-26 13:14:04 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2008-07-26 13:14:04 +0000 |
commit | af05ce0af6d35e668de297fc4961fa738272f13c (patch) | |
tree | 32d1f47915557308aa7e2f9212abb3a572b4b207 /ext | |
parent | 77baec3f6d57f2d37e89aceb758c6adf6a9538f6 (diff) | |
download | php-git-af05ce0af6d35e668de297fc4961fa738272f13c.tar.gz |
Fixed is_callable/call_user_func mess that had done different things for very similar arguments e.g. array("A","B") and "A::B"
Diffstat (limited to 'ext')
-rw-r--r-- | ext/reflection/php_reflection.c | 2 | ||||
-rwxr-xr-x | ext/spl/php_spl.c | 4 | ||||
-rwxr-xr-x | ext/spl/tests/spl_autoload_007.phpt | 6 | ||||
-rw-r--r-- | ext/standard/tests/array/array_map_object1.phpt | 20 | ||||
-rw-r--r-- | ext/standard/tests/array/array_map_object3.phpt | 4 | ||||
-rwxr-xr-x | ext/standard/tests/general_functions/bug40398.phpt | 8 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/callbacks_001.phpt | 4 |
7 files changed, 14 insertions, 34 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 44b81cd1c3..34eba20390 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1258,7 +1258,7 @@ static void _reflection_export(INTERNAL_FUNCTION_PARAMETERS, zend_class_entry *c params[0] = &reflector_ptr; params[1] = &output_ptr; - ZVAL_STRINGL(&fname, "export", sizeof("export") - 1, 0); + ZVAL_STRINGL(&fname, "reflection::export", sizeof("reflection::export") - 1, 0); fci.function_table = &reflection_ptr->function_table; fci.function_name = &fname; fci.object_pp = NULL; diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index ee8c6b9840..522cda68f5 100755 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -451,7 +451,7 @@ PHP_FUNCTION(spl_autoload_register) } } - if (!zend_is_callable_ex(zcallable, IS_CALLABLE_STRICT, &func_name, &func_name_len, &fcc, &error TSRMLS_CC)) { + if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_STRICT, &func_name, &func_name_len, &fcc, &error TSRMLS_CC)) { alfi.ce = fcc.calling_scope; alfi.func_ptr = fcc.function_handler; obj_ptr = fcc.object_pp; @@ -573,7 +573,7 @@ PHP_FUNCTION(spl_autoload_unregister) return; } - if (!zend_is_callable_ex(zcallable, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &func_name_len, &fcc, &error TSRMLS_CC)) { + if (!zend_is_callable_ex(zcallable, NULL, IS_CALLABLE_CHECK_SYNTAX_ONLY, &func_name, &func_name_len, &fcc, &error TSRMLS_CC)) { zend_throw_exception_ex(spl_ce_LogicException, 0 TSRMLS_CC, "Unable to unregister invalid function (%s)", error); if (error) { efree(error); diff --git a/ext/spl/tests/spl_autoload_007.phpt b/ext/spl/tests/spl_autoload_007.phpt index c0a06a952e..1a81f191c7 100755 --- a/ext/spl/tests/spl_autoload_007.phpt +++ b/ext/spl/tests/spl_autoload_007.phpt @@ -57,7 +57,7 @@ foreach($funcs as $idx => $func) <?php exit(0); ?> --EXPECTF-- string(22) "MyAutoLoader::notExist" -Function 'MyAutoLoader::notExist' not found (class 'MyAutoLoader' does not have a method 'notexist') +Function 'MyAutoLoader::notExist' not found (class 'MyAutoLoader' does not have a method 'notExist') string(22) "MyAutoLoader::noAccess" Function 'MyAutoLoader::noAccess' not callable (cannot access protected method MyAutoLoader::noAccess()) @@ -74,7 +74,7 @@ array(2) { [1]=> string(8) "notExist" } -Passed array does not specify an existing static method (class 'MyAutoLoader' does not have a method 'notexist') +Passed array does not specify an existing static method (class 'MyAutoLoader' does not have a method 'notExist') array(2) { [0]=> @@ -107,7 +107,7 @@ array(2) { [1]=> string(8) "notExist" } -Passed array does not specify an existing method (class 'MyAutoLoader' does not have a method 'notexist') +Passed array does not specify an existing method (class 'MyAutoLoader' does not have a method 'notExist') array(2) { [0]=> diff --git a/ext/standard/tests/array/array_map_object1.phpt b/ext/standard/tests/array/array_map_object1.phpt index 304e1cddf5..b96338cbbd 100644 --- a/ext/standard/tests/array/array_map_object1.phpt +++ b/ext/standard/tests/array/array_map_object1.phpt @@ -70,7 +70,7 @@ class ChildClass extends AbstractClass { private $var3; public function emptyFunction() { - echo "defined in child"; + echo "defined in child\n"; } } test(array('ChildClass', 'emptyFunction'), array(1, 2)); @@ -80,7 +80,7 @@ class FinalClass { private $var4; final function finalMethod() { - echo "This function can't be overloaded"; + echo "This function can't be overloaded\n"; } } test(array('FinalClass', 'finalMethod'), array(1, 2)); @@ -128,10 +128,6 @@ test(array('InterClass', 'square'), array(1, 2)); SimpleClass::square Strict Standards: array_map() expects parameter 1 to be a valid callback, non-static method SimpleClass::square() should not be called statically in %sarray_map_object1.php on line %d - -Strict Standards: Non-static method SimpleClass::square() should not be called statically in %sarray_map_object1.php on line %d - -Strict Standards: Non-static method SimpleClass::square() should not be called statically in %sarray_map_object1.php on line %d array(2) { [0]=> int(1) @@ -161,11 +157,9 @@ NULL ChildClass::emptyFunction Strict Standards: array_map() expects parameter 1 to be a valid callback, non-static method ChildClass::emptyFunction() should not be called statically in %sarray_map_object1.php on line %d - -Strict Standards: Non-static method ChildClass::emptyFunction() should not be called statically in %sarray_map_object1.php on line %d defined in child -Strict Standards: Non-static method ChildClass::emptyFunction() should not be called statically in %sarray_map_object1.php on line %d -defined in childarray(2) { +defined in child +array(2) { [0]=> NULL [1]=> @@ -176,11 +170,9 @@ defined in childarray(2) { FinalClass::finalMethod Strict Standards: array_map() expects parameter 1 to be a valid callback, non-static method FinalClass::finalMethod() should not be called statically in %sarray_map_object1.php on line %d - -Strict Standards: Non-static method FinalClass::finalMethod() should not be called statically in %sarray_map_object1.php on line %d This function can't be overloaded -Strict Standards: Non-static method FinalClass::finalMethod() should not be called statically in %sarray_map_object1.php on line %d -This function can't be overloadedarray(2) { +This function can't be overloaded +array(2) { [0]=> NULL [1]=> diff --git a/ext/standard/tests/array/array_map_object3.phpt b/ext/standard/tests/array/array_map_object3.phpt index d1a6d80629..9424c44110 100644 --- a/ext/standard/tests/array/array_map_object3.phpt +++ b/ext/standard/tests/array/array_map_object3.phpt @@ -74,7 +74,7 @@ array(3) { } -- accessing child method from parent class -- -Warning: array_map() expects parameter 1 to be a valid callback, class 'ParentClass' does not have a method 'staticchild' in %s on line %d +Warning: array_map() expects parameter 1 to be a valid callback, class 'ParentClass' does not have a method 'staticChild' in %s on line %d NULL -- accessing parent method using child class object -- array(3) { @@ -87,6 +87,6 @@ array(3) { } -- accessing child method using parent class object -- -Warning: array_map() expects parameter 1 to be a valid callback, class 'ParentClass' does not have a method 'staticchild' in %s on line %d +Warning: array_map() expects parameter 1 to be a valid callback, class 'ParentClass' does not have a method 'staticChild' in %s on line %d NULL Done diff --git a/ext/standard/tests/general_functions/bug40398.phpt b/ext/standard/tests/general_functions/bug40398.phpt index 3122141563..11fdde2c51 100755 --- a/ext/standard/tests/general_functions/bug40398.phpt +++ b/ext/standard/tests/general_functions/bug40398.phpt @@ -77,16 +77,8 @@ new Derived_6('6'); --EXPECTF-- Base::__construct(1) Base::__construct(2) - -Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Base::__construct() cannot be called statically, assuming $this from compatible context Derived_%d in %s on line %d Base::__construct(3) - -Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Base::__construct() cannot be called statically, assuming $this from compatible context Derived_%d in %s on line %d Base::__construct(4) - -Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Base::__construct() cannot be called statically, assuming $this from compatible context Derived_%d in %s on line %d Base::__construct(5) - -Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Base::__construct() cannot be called statically, assuming $this from compatible context Derived_%d in %s on line %d Base::__construct(6) ===DONE=== diff --git a/ext/standard/tests/general_functions/callbacks_001.phpt b/ext/standard/tests/general_functions/callbacks_001.phpt index 852bb46ecf..a58f19d932 100644 --- a/ext/standard/tests/general_functions/callbacks_001.phpt +++ b/ext/standard/tests/general_functions/callbacks_001.phpt @@ -97,12 +97,8 @@ B|who2 A ===FOREIGN=== parent|who - -Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method O::who() should not be called statically, assuming $this from compatible context P in %s on line %d O P|parent::who - -Strict Standards: call_user_func() expects parameter 1 to be a valid callback, non-static method O::who() should not be called statically, assuming $this from compatible context P in %s on line %d O $this|O::who O |