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_catch_finally_005.phpt
DanielEScherzer ea297654f4 Zend/*: fix a bunch of typos (GH-16017)
* Zend/*: fix a bunch of typos

* Zend/tests/try/try_catch_finally_005.phpt: update string length
2024-09-24 10:55:21 +02:00

53 lines
887 B
PHP

--TEST--
Try catch finally (break / cont in try block)
--CREDITS--
adoy
--FILE--
<?php
for ($i = 0; $i < 100 ; $i ++) {
try {
break;
} finally {
var_dump("break");
}
}
for ($i = 0; $i < 2; $i ++) {
try {
continue;
} finally {
var_dump("continue1");
}
}
for ($i = 0; $i < 3; $i ++) {
try {
try {
continue;
} finally {
var_dump("continue2");
if ($i == 1) {
throw new Exception("continue exception");
}
}
} catch (Exception $e) {
var_dump("caught");
} finally {
var_dump("finally");
}
}
?>
--EXPECT--
string(5) "break"
string(9) "continue1"
string(9) "continue1"
string(9) "continue2"
string(7) "finally"
string(9) "continue2"
string(6) "caught"
string(7) "finally"
string(9) "continue2"
string(7) "finally"