Arquivos
hhvm/hphp/test/quick/throw.php
T
ptarjan 503f75d08b Rename test directories
These names don't make sense now that we run both suites the same
way.
2013-04-17 09:06:51 -07: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";