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
/
slow
/
is_expression
/
is-expression-this2.php
blob
d1f2c6b1636863536b594159e722d098b3d56f6e
1
<
?hh
2
3
trait T
{
4
public static function
isThis
(
mixed
$x
):
void
{
5
if
(
$x
is this
) {
6
echo
"this
\n
"
;
7
}
else
{
8
echo
"not this
\n
"
;
9
}
10
}
11
}
12
13
class
C
{
14
use
T
;
15
}
16
17
final class
D
extends
C
{}
18
19
C
::
isThis
(
new
C
());
20
C
::
isThis
(
new
D
());
21
C
::
isThis
(
new
stdClass
());
22
C
::
isThis
(
null
);
23
C
::
isThis
(
true
);
24
C
::
isThis
(
1.5
);
25
C
::
isThis
(
1
);
26
C
::
isThis
(
STDIN
);
27
28
echo
"
\n
"
;
29
30
D
::
isThis
(
new
C
());
31
D
::
isThis
(
new
D
());
32
D
::
isThis
(
new
stdClass
());
33
D
::
isThis
(
null
);
34
D
::
isThis
(
true
);
35
D
::
isThis
(
1.5
);
36
D
::
isThis
(
1
);
37
D
::
isThis
(
STDIN
);
38
39
echo
"
\n
"
;
40
41
T
::
isThis
(
new
C
());
42
T
::
isThis
(
new
D
());