summaryrefslogtreecommitdiff
path: root/ext/opcache/tests/sccp_loop_var_free.phpt
blob: 5166823b0b689a52f771dda0bb8eff3dff2f4721 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--TEST--
Check that SCCP correctly handles non-terminating frees of loop variables
--FILE--
<?php
function test() {
    $arr = [];
    foreach ($arr as $item) {
        if (!empty($result)) {
            return $result;
        }
    }
    return 2;
}

var_dump(test());
?>
--EXPECT--
int(2)