xref: /PHP-8.3/ext/spl/tests/bug65006.phpt (revision ee510eed)
1--TEST--
2Bug #65006: spl_autoload_register fails with multiple callables using self, same method
3--FILE--
4<?php
5
6class first {
7    public static function init() {
8        spl_autoload_register(array('self','load'));
9    }
10    public static function load($class) {}
11}
12
13class second {
14    public static function init() {
15        spl_autoload_register(array('self','load'));
16    }
17    public static function load($class){}
18}
19
20first::init();
21second::init();
22var_dump(spl_autoload_functions());
23
24?>
25--EXPECTF--
26Deprecated: Use of "self" in callables is deprecated in %s on line %d
27
28Deprecated: Use of "self" in callables is deprecated in %s on line %d
29array(2) {
30  [0]=>
31  array(2) {
32    [0]=>
33    string(5) "first"
34    [1]=>
35    string(4) "load"
36  }
37  [1]=>
38  array(2) {
39    [0]=>
40    string(6) "second"
41    [1]=>
42    string(4) "load"
43  }
44}
45