ns_041.phpt 340 B

123456789101112131415161718192021
  1. --TEST--
  2. 041: Constants in namespace
  3. --FILE--
  4. <?php
  5. namespace test\ns1;
  6. const FOO = "ok\n";
  7. echo(FOO);
  8. echo(\test\ns1\FOO);
  9. echo(\test\ns1\FOO);
  10. echo(BAR);
  11. const BAR = "ok\n";
  12. --EXPECTF--
  13. ok
  14. ok
  15. ok
  16. Warning: Use of undefined constant BAR - assumed 'BAR' (this will throw an Error in a future version of PHP) in %sns_041.php on line 9
  17. BAR