mirror of
https://github.com/php/php-src.git
synced 2024-12-16 05:15:03 +08:00
ee510eed68
This deprecates all callables that are accepted by call_user_func($callable) but not by $callable(). In particular: "self::method" "parent::method" "static::method" ["self", "method"] ["parent", "method"] ["static", "method"] ["Foo", "Bar::method"] [new Foo, "Bar::method"] RFC: https://wiki.php.net/rfc/deprecate_partially_supported_callables Closes GH-7446.
39 lines
633 B
PHP
39 lines
633 B
PHP
--TEST--
|
|
Bug #78898: call_user_func(['parent', ...]) fails while other succeed
|
|
--FILE--
|
|
<?php
|
|
|
|
class A
|
|
{
|
|
protected function _x()
|
|
{
|
|
echo "a";
|
|
}
|
|
|
|
public function __call($methodName, array $arguments)
|
|
{
|
|
throw new Exception("Unknown method.");
|
|
}
|
|
}
|
|
|
|
class B extends A
|
|
{
|
|
public function x()
|
|
{
|
|
parent::_x();
|
|
call_user_func('parent::_x');
|
|
call_user_func(['parent', '_x']);
|
|
}
|
|
}
|
|
|
|
$b = new B;
|
|
$b->x();
|
|
|
|
?>
|
|
--EXPECTF--
|
|
a
|
|
Deprecated: Use of "parent" in callables is deprecated in %s on line %d
|
|
a
|
|
Deprecated: Use of "parent" in callables is deprecated in %s on line %d
|
|
a
|