xref: /PHP-8.1/ext/spl/tests/bug65006.phpt (revision c5401854)
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--EXPECT--
26array(2) {
27  [0]=>
28  array(2) {
29    [0]=>
30    string(5) "first"
31    [1]=>
32    string(4) "load"
33  }
34  [1]=>
35  array(2) {
36    [0]=>
37    string(6) "second"
38    [1]=>
39    string(4) "load"
40  }
41}
42