diff options
author | Felipe Pena <felipe@php.net> | 2008-06-05 18:33:00 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2008-06-05 18:33:00 +0000 |
commit | 7ba0803964d4cb1c6d5e34fdee825046077fe2f5 (patch) | |
tree | 25eca82f24914eb835de054da5b33b9f1c6f280c /Zend/tests/bug45186.phpt | |
parent | 604bfe4c0ba2bf97bc99362687f590d341629565 (diff) | |
download | php-git-7ba0803964d4cb1c6d5e34fdee825046077fe2f5.tar.gz |
- New tests
Diffstat (limited to 'Zend/tests/bug45186.phpt')
-rw-r--r-- | Zend/tests/bug45186.phpt | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Zend/tests/bug45186.phpt b/Zend/tests/bug45186.phpt new file mode 100644 index 0000000000..7cd54e2d52 --- /dev/null +++ b/Zend/tests/bug45186.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug #45186 (__call depends on __callstatic in class scope) +--FILE-- +<?php + +class bar { + public function __call($a, $b) { + print "__call:\n"; + var_dump($a); + } + static public function __callstatic($a, $b) { + print "__callstatic:\n"; + var_dump($a); + } + public function test() { + self::ABC(); + bar::ABC(); + call_user_func(array('BAR', 'xyz')); + call_user_func('BAR::www'); + call_user_func(array('self', 'y')); + call_user_func('self::y'); + } + static function x() { + print "ok\n"; + } +} + +$x = new bar; + +$x->test(); + +call_user_func(array('BAR','x')); +call_user_func('BAR::www'); +call_user_func('self::y'); + +?> +--EXPECTF-- +__call: +string(3) "ABC" +__call: +string(3) "ABC" +__call: +string(3) "xyz" +__call: +string(3) "www" +__call: +string(1) "y" +__call: +string(1) "y" +ok +__callstatic: +string(3) "www" + +Fatal error: Cannot access self:: when no class scope is active in %s on line %d |