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
Basic flow analysis on if statements
[hiphop-php.git]
/
hphp
/
test
/
slow
/
readonly
/
shape.php
blob
4f8b52625c937cc226926dd52848970915bd2546
1
<
?hh
//strict
2
3
<<
file
:
__EnableUnstableFeatures
(
'readonly'
)>>
4
5
class
P
{
6
public function
__construct
(
public
int
$i
) { }
7
}
8
9
<<
__EntryPoint
>>
10
function
main
() {
11
$ro
=
readonly
new
P
(
1
);
12
$mut
=
new
P
(
1
);
13
$p
=
shape
(
"a"
=>
$ro
,
"b"
=>
$mut
);
14
$p
[
"a"
]->
i
=
4
;
// error, $p is mutable
15
}