diff options
author | Dmitry Stogov <dmitry@php.net> | 2007-09-28 19:52:53 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2007-09-28 19:52:53 +0000 |
commit | f32ffe9b430b718628f868e449c1fcbdc8ec9ef6 (patch) | |
tree | d46f435df40bcfe67bbab884f612a3551448431e /Zend/tests/ns_026.phpt | |
parent | 1674976346b5d8294eae99ec395f101f14405e2d (diff) | |
download | php-git-f32ffe9b430b718628f868e449c1fcbdc8ec9ef6.tar.gz |
Namespaces
Diffstat (limited to 'Zend/tests/ns_026.phpt')
-rwxr-xr-x | Zend/tests/ns_026.phpt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Zend/tests/ns_026.phpt b/Zend/tests/ns_026.phpt new file mode 100755 index 0000000000..ad8654db5f --- /dev/null +++ b/Zend/tests/ns_026.phpt @@ -0,0 +1,30 @@ +--TEST-- +026: Name ambiguity (class name & namespace name) +--FILE-- +<?php +namespace Foo; + +class Foo { + function __construct() { + echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; + } + static function Bar() { + echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; + } +} + +function Bar() { + echo "Func - ".__FUNCTION__."\n"; +} + +$x = new Foo; +Foo::Bar(); +$x = new Foo::Foo; +Foo::Foo::Bar(); +::Foo::Bar(); +--EXPECT-- +Method - Foo::Foo::__construct +Func - Foo::Bar +Method - Foo::Foo::__construct +Method - Foo::Foo::Bar +Func - Foo::Bar |