1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/Zend/tests/try/try_finally_022.phpt
2020-02-03 22:52:20 +01:00

41 lines
749 B
PHP

--TEST--
Try finally (exception in "return" statement)
--FILE--
<?php
class A {
public $x = 1;
public $y = 2;
function __destruct() {
throw new Exception();
}
}
try{
$a = 0;
switch ($a) {
case 0:
}
switch ($a) {
case 0:
}
switch ($a) {
case 0:
}
foreach([new stdClass()] as $x) {
foreach(new A() as $a) {
foreach([new stdClass()] as $y) {
try {
if (0) { echo "0" . (int)5; }
return $a;
} catch (Exception $e) {
echo "exception1\n";
}
}
}
}
} catch (Exception $e) {
echo "exception2\n";
}
?>
--EXPECT--
exception2