php-src/Zend/tests/temporary_cleaning_007.phpt
2018-10-14 19:45:12 +02:00

23 lines
481 B
PHP

--TEST--
Exception inside a foreach loop with return
--FILE--
<?php
class saboteurTestController {
public function isConsistent() { throw new \Exception(); }
}
$controllers = array(new saboteurTestController(),new saboteurTestController());
foreach ($controllers as $controller) {
try {
if ($controller->isConsistent()) {
return $controller;
}
} catch (\Exception $e) {
echo "Exception\n";
}
}
?>
--EXPECT--
Exception
Exception