Arquivos
hhvm/hphp/test/vm/exception_bug_more.php
T
jdelong 31222e2c84 Fix another bug in "Fix a bug in exception handling"
When we skip EHEnts for catch blocks that we aren't going to
enter, we still need to count them in the handledCount so that we run
the appropriate fault funclet (see the unit test).  Before this
change, it would fail to account for the catch handler and end up
running the fault funclet twice, leading to an assertion about
IterFree trying to free an already-freed iterator.
2013-02-11 06:07:21 -08:00

17 linhas
255 B
PHP

<?php
function thrower() {
throw new Exception("Not MyJunk");
}
function foo() {
foreach (array(1,2,3) as $x) {
try {
thrower();
} catch (MyJunk $z) { echo "Not Here\n"; }
}
}
try {
foo();
} catch (Exception $x) { echo "done\n"; }