bug38653.phpt 486 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Bug #38653 (memory leak in ReflectionClass::getConstant())
  3. --FILE--
  4. <?php
  5. class foo {
  6. const cons = 10;
  7. const cons1 = "";
  8. const cons2 = "test";
  9. }
  10. class bar extends foo {
  11. }
  12. $foo = new ReflectionClass("foo");
  13. var_dump($foo->getConstant("cons"));
  14. var_dump($foo->getConstant("cons1"));
  15. var_dump($foo->getConstant("cons2"));
  16. var_dump($foo->getConstant("no such const"));
  17. echo "Done\n";
  18. ?>
  19. --EXPECT--
  20. int(10)
  21. string(0) ""
  22. string(4) "test"
  23. bool(false)
  24. Done