mirror of
https://github.com/php/php-src.git
synced 2026-03-29 03:32:20 +02:00
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.
25 lines
593 B
PHP
25 lines
593 B
PHP
--TEST--
|
|
Bug #37138 (autoloader tries to load callback'ed self and parent)
|
|
--FILE--
|
|
<?php
|
|
spl_autoload_register(function ($CN) { var_dump ($CN); });
|
|
class st {
|
|
public static function e () {echo ("EHLO\n");}
|
|
public static function e2 () {call_user_func (array ('self', 'e'));}
|
|
}
|
|
class stch extends st {
|
|
public static function g () {call_user_func (array ('parent', 'e'));}
|
|
}
|
|
st::e ();
|
|
st::e2 ();
|
|
stch::g ();
|
|
?>
|
|
--EXPECTF--
|
|
EHLO
|
|
|
|
Deprecated: Use of "self" in callables is deprecated in %s on line %d
|
|
EHLO
|
|
|
|
Deprecated: Use of "parent" in callables is deprecated in %s on line %d
|
|
EHLO
|