Annotation of embedaddon/php/Zend/tests/ns_026.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: 026: Name ambiguity (class name & namespace name)
! 3: --FILE--
! 4: <?php
! 5: namespace Foo;
! 6:
! 7: class Foo {
! 8: function __construct() {
! 9: echo "Method - ".__CLASS__."::".__FUNCTION__."\n";
! 10: }
! 11: static function Bar() {
! 12: echo "Method - ".__CLASS__."::".__FUNCTION__."\n";
! 13: }
! 14: }
! 15:
! 16: function Bar() {
! 17: echo "Func - ".__FUNCTION__."\n";
! 18: }
! 19:
! 20: $x = new Foo;
! 21: \Foo\Bar();
! 22: $x = new \Foo\Foo;
! 23: \Foo\Foo::Bar();
! 24: \Foo\Bar();
! 25: Foo\Bar();
! 26: --EXPECTF--
! 27: Method - Foo\Foo::__construct
! 28: Func - Foo\Bar
! 29: Method - Foo\Foo::__construct
! 30: Method - Foo\Foo::Bar
! 31: Func - Foo\Bar
! 32:
! 33: Fatal error: Call to undefined function Foo\Foo\Bar() in %sns_026.php on line %d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>