xref: /PHP-8.2/Zend/tests/ns_001.phpt (revision 7aacc705)
1--TEST--
2001: Class in namespace
3--FILE--
4<?php
5namespace test\ns1;
6
7class Foo {
8
9  function __construct() {
10    echo __CLASS__,"\n";
11  }
12
13  function bar() {
14    echo __CLASS__,"\n";
15  }
16
17  static function baz() {
18    echo __CLASS__,"\n";
19  }
20}
21
22$x = new Foo;
23$x->bar();
24Foo::baz();
25$y = new \test\ns1\Foo;
26$y->bar();
27\test\ns1\Foo::baz();
28?>
29--EXPECT--
30test\ns1\Foo
31test\ns1\Foo
32test\ns1\Foo
33test\ns1\Foo
34test\ns1\Foo
35test\ns1\Foo
36