Annotation of embedaddon/php/Zend/tests/bug45186_2.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #45186.2 (__call depends on __callstatic in class scope)
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: class bar  {
        !             7:        public function __call($a, $b) {
        !             8:                print "__call:\n";
        !             9:                var_dump($a);
        !            10:        }
        !            11:        public function test() {
        !            12:                self::ABC();
        !            13:                bar::ABC();
        !            14:                call_user_func(array('BAR', 'xyz'));
        !            15:                call_user_func('BAR::www');
        !            16:                call_user_func(array('self', 'y'));
        !            17:                call_user_func('self::y');
        !            18:        }
        !            19:        static function x() { 
        !            20:                print "ok\n";
        !            21:        }
        !            22: }
        !            23: 
        !            24: $x = new bar;
        !            25: 
        !            26: $x->test();
        !            27: 
        !            28: call_user_func(array('BAR','x'));
        !            29: call_user_func('BAR::www');
        !            30: call_user_func('self::y');
        !            31: 
        !            32: ?>
        !            33: --EXPECTF--
        !            34: __call:
        !            35: string(3) "ABC"
        !            36: __call:
        !            37: string(3) "ABC"
        !            38: __call:
        !            39: string(3) "xyz"
        !            40: __call:
        !            41: string(3) "www"
        !            42: __call:
        !            43: string(1) "y"
        !            44: __call:
        !            45: string(1) "y"
        !            46: ok
        !            47: 
        !            48: Warning: call_user_func() expects parameter 1 to be a valid callback, class 'bar' does not have a method 'www' in %s on line %d
        !            49: 
        !            50: Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access self:: when no class scope is active in %sbug45186_2.php on line 27

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