bug44827.phpt 439 B

123456789101112131415161718192021
  1. --TEST--
  2. Bug #44827 (define() allows :: in constant names)
  3. --FILE--
  4. <?php
  5. try {
  6. define('foo::bar', 1);
  7. } catch (ValueError $exception) {
  8. echo $exception->getMessage() . "\n";
  9. }
  10. try {
  11. define('::', 1);
  12. } catch (ValueError $exception) {
  13. echo $exception->getMessage() . "\n";
  14. }
  15. ?>
  16. --EXPECT--
  17. define(): Argument #1 ($constant_name) cannot be a class constant
  18. define(): Argument #1 ($constant_name) cannot be a class constant