Arquivos
hhvm/hphp/test/vm/throw.php
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08:00

31 linhas
431 B
PHP

<?php
class Ex1 extends Exception {
function getString() {
return "Ex1\n";
}
}
class Ex2 extends Exception {
function getString() {
return "Ex2\n";
}
}
function foo() {
throw new Ex2();
}
try {
foo();
echo "should not be here\n";
} catch (Ex1 $e) {
$a = $e->getString();
echo "caught exception $a";
} catch (Ex2 $e) {
$a = $e->getString();
echo "caught exception $a";
}
echo "after exception\n";