File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / spl / tests / bug40091.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:48:01 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

--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===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>