diff options
Diffstat (limited to 'ext/spl/tests/bug40091.phpt')
| -rw-r--r-- | ext/spl/tests/bug40091.phpt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/ext/spl/tests/bug40091.phpt b/ext/spl/tests/bug40091.phpt new file mode 100644 index 0000000..eb157e7 --- /dev/null +++ b/ext/spl/tests/bug40091.phpt @@ -0,0 +1,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=== |
