mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00: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.
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
--TEST--
|
|
ZE2 Late Static Binding parent::/self:: forwarding and __callStatic
|
|
--FILE--
|
|
<?php
|
|
class A {
|
|
static function test() {
|
|
echo "A\n";
|
|
}
|
|
static function __callstatic($name, $args) {
|
|
call_user_func("static::test");
|
|
}
|
|
}
|
|
class B extends A {
|
|
static function test() {
|
|
echo "B\n";
|
|
}
|
|
static function __callstatic($name, $args) {
|
|
parent::__callstatic($name, $args);
|
|
call_user_func_array("parent::__callstatic", array($name, $args));
|
|
parent::foo();
|
|
call_user_func_array("parent::foo", $args);
|
|
call_user_func_array(array("parent","foo"), $args);
|
|
}
|
|
}
|
|
B::foo();
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: Use of "static" in callables is deprecated in %s on line %d
|
|
B
|
|
|
|
Deprecated: Use of "parent" in callables is deprecated in %s on line %d
|
|
|
|
Deprecated: Use of "static" in callables is deprecated in %s on line %d
|
|
B
|
|
|
|
Deprecated: Use of "static" in callables is deprecated in %s on line %d
|
|
B
|
|
|
|
Deprecated: Use of "parent" in callables is deprecated in %s on line %d
|
|
|
|
Deprecated: Use of "static" in callables is deprecated in %s on line %d
|
|
B
|
|
|
|
Deprecated: Use of "parent" in callables is deprecated in %s on line %d
|
|
|
|
Deprecated: Use of "static" in callables is deprecated in %s on line %d
|
|
B
|