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
Updating submodules
[hiphop-php.git]
/
hphp
/
test
/
slow
/
def-sink-bug.php
blob
71f16ea60e36ae994c15a7c556e838f5c2a0e5c1
1
<
?hh
2
3
<<
__NEVER_INLINE
>>
4
function
foo
(
$v
) {
5
$c
=
count
(
$v
);
6
$v
[] =
__hhvm_intrinsics\
launder_value
(
4
);
7
if
(
$c
!=
1
) {
8
var_dump
(
'
$c
'
,
$c
);
9
}
10
}
11
12
<<
__EntryPoint
>>
13
function
main
() {
14
// Bias the profile towards COWing the array
15
for
(
$i
=
0
;
$i
<
30
;
$i
++
) {
16
$s_vec
=
vec
[
3
];
17
foo
(
$s_vec
);
18
}
19
20
// Actual test.
21
$vec
=
vec
[
rand
(
1
,
2
)];
// Non static vec.
22
foo
(
$vec
);
23
24
echo
"Done!"
;
25
}