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
global statement removal: hphp/test [7/x]
[hiphop-php.git]
/
hphp
/
test
/
quick
/
GLOBALS.php
blob
ad88f8e24447be356d2d07a6463b4056c4e42125
1
<
?hh
2
3
print
"Test begin
\n
"
;
4
5
# Get a key that doesn't exist in $GLOBALS.
6
$k
=
'k'
;
7
while
(
isset
(
$GLOBALS
[
$k
])) {
8
$k
.=
'k'
;
9
}
10
11
$a
=
$GLOBALS
;
12
$GLOBALS
[
$k
] =
42
;
13
if
(
isset
(
$GLOBALS
[
$k
])) {
14
print
"Key is set in \
$GLOBALS\n
"
;
15
}
16
if
(
isset
(
$a
[
$k
])) {
17
print
"Key set visible via \
$a\n
"
;
18
}
19
$b
=
$a
;
20
$a
[
$k
]
++
;
21
if
(
$b
[
$k
] ==
43
) {
22
print
"Key update visible via \
$b\n
"
;
23
}
24
25
print
"Test end
\n
"
;