018.phpt 649 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. constant() tests
  3. --FILE--
  4. <?php
  5. var_dump(constant());
  6. var_dump(constant("", ""));
  7. var_dump(constant(""));
  8. var_dump(constant(array()));
  9. define("TEST_CONST", 1);
  10. var_dump(constant("TEST_CONST"));
  11. define("TEST_CONST2", "test");
  12. var_dump(constant("TEST_CONST2"));
  13. echo "Done\n";
  14. ?>
  15. --EXPECTF--
  16. Warning: constant() expects exactly 1 parameter, 0 given in %s on line %d
  17. NULL
  18. Warning: constant() expects exactly 1 parameter, 2 given in %s on line %d
  19. NULL
  20. Warning: constant(): Couldn't find constant in %s on line %d
  21. NULL
  22. Warning: constant() expects parameter 1 to be string, array given in %s on line %d
  23. NULL
  24. int(1)
  25. string(4) "test"
  26. Done