ns_001.phpt 432 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. 001: Class in namespace
  3. --FILE--
  4. <?php
  5. namespace test\ns1;
  6. class Foo {
  7. function __construct() {
  8. echo __CLASS__,"\n";
  9. }
  10. function bar() {
  11. echo __CLASS__,"\n";
  12. }
  13. static function baz() {
  14. echo __CLASS__,"\n";
  15. }
  16. }
  17. $x = new Foo;
  18. $x->bar();
  19. Foo::baz();
  20. $y = new \test\ns1\Foo;
  21. $y->bar();
  22. \test\ns1\Foo::baz();
  23. ?>
  24. --EXPECT--
  25. test\ns1\Foo
  26. test\ns1\Foo
  27. test\ns1\Foo
  28. test\ns1\Foo
  29. test\ns1\Foo
  30. test\ns1\Foo