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
Readonly in emitter flag
[hiphop-php.git]
/
hphp
/
test
/
slow
/
readonly
/
darray.php
blob
81630ab1f3a965777b4dd9e9173628b4b239a13c
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
=
darray
[
1
=>
$ro
,
2
=>
$mut
];
14
// error, $p[2] is readonly because $p is readonly
15
$p
[
2
]->
i
=
4
;
16
}