xref: /PHP-8.3/Zend/tests/ns_028.phpt (revision 7aacc705)
1--TEST--
2028: Name ambiguity (class name & external namespace name)
3--FILE--
4<?php
5require "ns_028.inc";
6
7class 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$x = new Foo;
17Foo\Bar();
18$x = new Foo\Foo;
19Foo\Foo::Bar();
20\Foo\Bar();
21?>
22--EXPECT--
23Method - Foo::__construct
24Func   - Foo\Bar
25Method - Foo\Foo::__construct
26Method - Foo\Foo::Bar
27Func   - Foo\Bar
28