summaryrefslogtreecommitdiff
path: root/Zend/tests/ns_001.phpt
blob: ef12ce5aaf69d5c77d3b36be2dd5f90b33160748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--TEST--
001: Class in namespace
--FILE--
<?php
namespace test\ns1;

class Foo {

  function __construct() {
    echo __CLASS__,"\n";
  }

  function bar() {
    echo __CLASS__,"\n";
  }

  static function baz() {
    echo __CLASS__,"\n";
  }
}

$x = new Foo;
$x->bar();
Foo::baz();
$y = new \test\ns1\Foo;
$y->bar();
\test\ns1\Foo::baz();
?>
--EXPECT--
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo