Annotation of embedaddon/php/Zend/tests/bug45186.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #45186 (__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: static public function __callstatic($a, $b) {
! 12: print "__callstatic:\n";
! 13: var_dump($a);
! 14: }
! 15: public function test() {
! 16: self::ABC();
! 17: bar::ABC();
! 18: call_user_func(array('BAR', 'xyz'));
! 19: call_user_func('BAR::www');
! 20: call_user_func(array('self', 'y'));
! 21: call_user_func('self::y');
! 22: }
! 23: static function x() {
! 24: print "ok\n";
! 25: }
! 26: }
! 27:
! 28: $x = new bar;
! 29:
! 30: $x->test();
! 31:
! 32: call_user_func(array('BAR','x'));
! 33: call_user_func('BAR::www');
! 34: call_user_func('self::y');
! 35:
! 36: ?>
! 37: --EXPECTF--
! 38: __call:
! 39: string(3) "ABC"
! 40: __call:
! 41: string(3) "ABC"
! 42: __call:
! 43: string(3) "xyz"
! 44: __call:
! 45: string(3) "www"
! 46: __call:
! 47: string(1) "y"
! 48: __call:
! 49: string(1) "y"
! 50: ok
! 51: __callstatic:
! 52: string(3) "www"
! 53:
! 54: Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access self:: when no class scope is active in %sbug45186.php on line 31
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>