xref: /PHP-7.1/Zend/tests/bug44184.phpt (revision 8c32f99c)
1--TEST--
2Bug #44184 (Double free of loop-variable on exception)
3--FILE--
4<?php
5function foo() {
6	$x = array(1,2,3);
7	foreach ($x as $a) {
8		while (1) {
9			throw new Exception();
10		}
11	    return;
12	}
13}
14try {
15	foo();
16} catch (Exception $ex) {
17	echo "ok\n";
18}
19?>
20--EXPECT--
21ok
22