mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01: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.
45 lines
837 B
PHP
45 lines
837 B
PHP
--TEST--
|
|
Bug #65006: spl_autoload_register fails with multiple callables using self, same method
|
|
--FILE--
|
|
<?php
|
|
|
|
class first {
|
|
public static function init() {
|
|
spl_autoload_register(array('self','load'));
|
|
}
|
|
public static function load($class) {}
|
|
}
|
|
|
|
class second {
|
|
public static function init() {
|
|
spl_autoload_register(array('self','load'));
|
|
}
|
|
public static function load($class){}
|
|
}
|
|
|
|
first::init();
|
|
second::init();
|
|
var_dump(spl_autoload_functions());
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: Use of "self" in callables is deprecated in %s on line %d
|
|
|
|
Deprecated: Use of "self" in callables is deprecated in %s on line %d
|
|
array(2) {
|
|
[0]=>
|
|
array(2) {
|
|
[0]=>
|
|
string(5) "first"
|
|
[1]=>
|
|
string(4) "load"
|
|
}
|
|
[1]=>
|
|
array(2) {
|
|
[0]=>
|
|
string(6) "second"
|
|
[1]=>
|
|
string(4) "load"
|
|
}
|
|
}
|