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
Error on self::class on non final classes
[hiphop-php.git]
/
hphp
/
hack
/
test
/
typecheck
/
case_null.php
blob
15853795846e7876b2d0aff7cc1001f4338ffbe8
1
<
?hh
// strict
2
// Copyright 2004-present Facebook. All Rights Reserved.
3
4
enum Enum
:
int
{
5
A
=
0
;
6
B
=
1
;
7
C
=
2
;
8
D
=
3
;
9
}
10
11
function
f
(
Enum
$e
):
int
{
12
$x
=
null
;
13
switch
(
$e
) {
14
case
Enum
::
A
:
15
$x
=
1
;
16
break
;
17
case
Enum
::
B
:
18
case
Enum
::
C
:
19
$x
=
2
;
20
break
;
21
case
Enum
::
D
:
22
return
3
;
23
}
24
return
$x
;
25
}