mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
Make test valid for either "register globals" setting.
This commit is contained in:
parent
e3ae02255b
commit
c2c16263e8
@ -7,15 +7,16 @@ Testing $argc and $argv handling
|
||||
ab+cd+ef+123+test
|
||||
--FILE--
|
||||
<?php
|
||||
if(ini_get('register_globals') != '') {
|
||||
for($i=0;$i<$argc;$i++) {
|
||||
echo "$i: ".$argv[$i]."\n";
|
||||
}
|
||||
} else {
|
||||
for($i=0;$i<$_SERVER['argc'];$i++) {
|
||||
echo "$i: ".$_SERVER['argv'][$i]."\n";
|
||||
}
|
||||
}
|
||||
|
||||
if (!ini_get('register_globals')) {
|
||||
$argc = $_SERVER['argc'];
|
||||
$argv = $_SERVER['argv'];
|
||||
}
|
||||
|
||||
for ($i=0; $i<$argc; $i++) {
|
||||
echo "$i: ".$argv[$i]."\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
0: ab
|
||||
|
Loading…
Reference in New Issue
Block a user