Make test valid for either "register globals" setting.

This commit is contained in:
Preston L. Bannister 2002-05-16 21:56:08 +00:00
parent e3ae02255b
commit c2c16263e8

View File

@ -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