xref: /PHP-8.3/Zend/tests/bug44653.phpt (revision f8d79582)
1--TEST--
2Bug #44653 (Invalid namespace name resolution)
3--FILE--
4<?php
5namespace A;
6const XX=1;
7function fooBar() { echo __FUNCTION__ . PHP_EOL; }
8
9namespace B;
10class A {
11    static function fooBar() { echo "bag1\n"; }
12}
13class B {
14    static function fooBar() { echo "bag2\n"; }
15}
16function fooBar() { echo __FUNCTION__ . PHP_EOL; }
17var_dump(\A\XX);
18A::fooBar();
19\A\fooBar();
20B::fooBar();
21fooBar();
22\B\fooBar();
23?>
24--EXPECT--
25int(1)
26bag1
27A\fooBar
28bag2
29B\fooBar
30B\fooBar
31