bug44827.phpt 459 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #44827 (Class error when trying to access :: as constant)
  3. --CREDITS--
  4. Sebastian Schürmann
  5. sebs@php.net
  6. Testfest Munich 2009
  7. --FILE--
  8. <?php
  9. try {
  10. define('::', true);
  11. } catch (ValueError $e) {
  12. echo $e->getMessage(), "\n";
  13. }
  14. try {
  15. constant('::');
  16. } catch (Error $e) {
  17. echo $e->getMessage(), "\n";
  18. }
  19. ?>
  20. --EXPECTF--
  21. define(): Argument #1 ($constant_name) cannot be a class constant
  22. Fatal error: Class "" not found in %s on line %d