php-src/Zend/tests/lsb_011.phpt
Nikita Popov ee510eed68 Deprecate partially supported callables
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.
2021-10-22 10:15:24 +02:00

25 lines
443 B
PHP

--TEST--
ZE2 Late Static Binding call to static::method() from internal function (array)
--FILE--
<?php
class Test1 {
static function ok() {
echo "bug";
}
static function test() {
call_user_func(array("static","ok"));
}
}
class Test2 extends Test1 {
static function ok() {
echo "ok";
}
}
Test2::test();
?>
--EXPECTF--
Deprecated: Use of "static" in callables is deprecated in %s on line %d
ok