Annotation of embedaddon/php/ext/spl/tests/bug40091.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #40091 (issue with spl_autoload_register() and 2 instances of the same class)
        !             3: --FILE--
        !             4: <?php
        !             5: class MyAutoloader {
        !             6:        function __construct($directory_to_use) {}
        !             7:        function autoload($class_name) {
        !             8:                // code to autoload based on directory
        !             9:        }
        !            10: }
        !            11: 
        !            12: $autloader1 = new MyAutoloader('dir1');
        !            13: spl_autoload_register(array($autloader1, 'autoload'));
        !            14: 
        !            15: $autloader2 = new MyAutoloader('dir2');
        !            16: spl_autoload_register(array($autloader2, 'autoload'));
        !            17: 
        !            18: print_r(spl_autoload_functions());
        !            19: ?>
        !            20: ===DONE===
        !            21: --EXPECT--
        !            22: Array
        !            23: (
        !            24:     [0] => Array
        !            25:         (
        !            26:             [0] => MyAutoloader Object
        !            27:                 (
        !            28:                 )
        !            29: 
        !            30:             [1] => autoload
        !            31:         )
        !            32: 
        !            33:     [1] => Array
        !            34:         (
        !            35:             [0] => MyAutoloader Object
        !            36:                 (
        !            37:                 )
        !            38: 
        !            39:             [1] => autoload
        !            40:         )
        !            41: 
        !            42: )
        !            43: ===DONE===

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