bug68412.phpt 480 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #68412 (Infinite recursion with __call can make the program crash/segfault)
  3. --SKIPIF--
  4. <?php
  5. if (getenv("USE_ZEND_ALLOC") !== "1") {
  6. die("skip Need Zend MM enabled");
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. class C {
  12. public function __call($x, $y) {
  13. global $z;
  14. $z->bar();
  15. }
  16. }
  17. $z = new C;
  18. function main() {
  19. global $z;
  20. $z->foo();
  21. }
  22. main();
  23. ?>
  24. --EXPECTF--
  25. Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %sbug68412.php on line %d