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