summaryrefslogtreecommitdiff
path: root/ext/spl/tests/bug40091.phpt
blob: eb157e72ae4bf67b9fc4c672fb7a60ae7873473c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--TEST--
Bug #40091 (issue with spl_autoload_register() and 2 instances of the same class)
--FILE--
<?php
class MyAutoloader {
	function __construct($directory_to_use) {}
	function autoload($class_name) {
		// code to autoload based on directory
	}
}

$autloader1 = new MyAutoloader('dir1');
spl_autoload_register(array($autloader1, 'autoload'));

$autloader2 = new MyAutoloader('dir2');
spl_autoload_register(array($autloader2, 'autoload'));

print_r(spl_autoload_functions());
?>
===DONE===
--EXPECT--
Array
(
    [0] => Array
        (
            [0] => MyAutoloader Object
                (
                )

            [1] => autoload
        )

    [1] => Array
        (
            [0] => MyAutoloader Object
                (
                )

            [1] => autoload
        )

)
===DONE===