1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00
Files
archived-php-src/Zend/tests/try/catch_finally_003.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

41 lines
618 B
PHP

--TEST--
Try catch finally (with multi-returns)
--FILE--
<?php
function dummy($msg) {
var_dump($msg);
}
function foo ($a) {
try {
dummy("try");
return $a;
} catch (Exception $e) {
throw $e;
} finally {
dummy("finally");
return "finally";
}
return "end";
}
function &bar($a) {
try {
echo "try\n";
throw new Exception("ex");
} catch (Exception $e) {
} finally {
return $a;
}
return ($c = "end");
}
var_dump(foo("para"));
var_dump(bar("para"));
?>
--EXPECT--
string(3) "try"
string(7) "finally"
string(7) "finally"
try
string(4) "para"