repo.or.cz
/
hiphop-php.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Handle this typehints
[hiphop-php.git]
/
hphp
/
test
/
quick
/
throw.php
blob
032de775e7cc99da668d561af90e15840d764062
1
<
?hh
2
3
class
Ex1
extends
Exception
{
4
function
getString
() {
5
return
"Ex1
\n
"
;
6
}
7
}
8
9
class
Ex2
extends
Exception
{
10
function
getString
() {
11
return
"Ex2
\n
"
;
12
}
13
}
14
15
function
foo
() {
16
throw new
Ex2
();
17
}
18
19
try
{
20
foo
();
21
echo
"should not be here
\n
"
;
22
}
catch
(
Ex1
$e
) {
23
$a
=
$e
->
getString
();
24
echo
"caught exception
$a
"
;
25
}
catch
(
Ex2
$e
) {
26
$a
=
$e
->
getString
();
27
echo
"caught exception
$a
"
;
28
}
29
30
echo
"after exception
\n
"
;