dynamic_call_freeing.phpt 505 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Freeing of function "name" when dynamic call fails
  3. --FILE--
  4. <?php
  5. try {
  6. $bar = "bar";
  7. ("foo" . $bar)();
  8. } catch (Error $e) {
  9. echo $e->getMessage(), "\n";
  10. }
  11. try {
  12. $bar = ["bar"];
  13. (["foo"] + $bar)();
  14. } catch (Error $e) {
  15. echo $e->getMessage(), "\n";
  16. }
  17. try {
  18. (new stdClass)();
  19. } catch (Error $e) {
  20. echo $e->getMessage(), "\n";
  21. }
  22. ?>
  23. --EXPECT--
  24. Call to undefined function foobar()
  25. Array callback must have exactly two elements
  26. Object of type stdClass is not callable