xref: /php-src/ext/opcache/tests/jit/bug80447.phpt (revision c16ad918)
1--TEST--
2Bug #80447 (Strange out of memory error when running with JIT)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.protect_memory=1
8--EXTENSIONS--
9opcache
10--FILE--
11<?php
12function createTree($depth) {
13    if (!$depth) {
14        return [null, null];
15    }
16    $depth--;
17
18    return [
19        createTree($depth),
20        createTree($depth)
21    ];
22}
23
24function checkTree($treeNode) {
25    return 1
26        + ($treeNode[0][0] === null ? 1 : checkTree($treeNode[0]))
27        + ($treeNode[1][0] === null ? 1 : checkTree($treeNode[1]));
28}
29
30$tree = createTree(12);
31var_dump(checkTree($tree));
32?>
33--EXPECT--
34int(8191)
35