blob: 0e29ed6c333c9ae1bbcd57315f9ba9383d5121f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
--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
|