ns_012.phpt 433 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. 012: Import in namespace and functions
  3. --FILE--
  4. <?php
  5. namespace test\ns1;
  6. function foo() {
  7. echo __FUNCTION__,"\n";
  8. }
  9. use test\ns1 as ns2;
  10. use test as ns3;
  11. foo();
  12. bar();
  13. \test\ns1\foo();
  14. \test\ns1\bar();
  15. ns2\foo();
  16. ns2\bar();
  17. ns3\ns1\foo();
  18. ns3\ns1\bar();
  19. function bar() {
  20. echo __FUNCTION__,"\n";
  21. }
  22. ?>
  23. --EXPECT--
  24. test\ns1\foo
  25. test\ns1\bar
  26. test\ns1\foo
  27. test\ns1\bar
  28. test\ns1\foo
  29. test\ns1\bar
  30. test\ns1\foo
  31. test\ns1\bar