From: sikachu at beezone dot net Operating system: Windows 2000 PHP version: 5.0.0RC2 PHP Bug Type: Unknown/Other Function Bug description: $QUERY_STRING is define with null instead stay undefine
Description: ------------ I upgraded from PHP 4.3.4 to PHP 5.0 RC3 yesterday. When I tried to run the script that check for the query string and then refresh to the page, the query string return the invalid value. This behavior I found only in PHP 5.0 RC3 I'll show you the result with these thing: echo $QUERY_STRING; isset($QUERY_STRING); $QUERY_STRING == ""; For example, assume that the script URL is http://somewhere.com/index.php If I call it like this: http://somewhere.com/index.php?foo echo $QUERY_STRING; // show foo isset($QUERY_STRING); // return true $QUERY_STRING == ""; // return false But, here is the problem. If I call it like this: http://somewhere.com/index.php echo $QUERY_STRING; // show ""(nothing) isset($QUERY_STRING); // return true << unexpected $QUERY_STRING == ""; // return true The code that I use for test will be in the next section. My PHP configuration based on php.ini-dist. I changed register_global to be On, and then add php_mysql & php_mysqli extension to it. Reproduce code: --------------- if(isset($QUERY_STRING)) { echo "Your query string is defined\n"; } if($QUERY_STRING == "") { echo "Your query string is null\n"; } if($QUERY_STRING == " ") { echo "Your query string contain just a space\n"; } echo "Here is your query string: '".$QUERY_STRING."'"; Expected result: ---------------- Your query string is null Here is your query string: '' Actual result: -------------- Your query string is defined Your query string is null Here is your query string: '' -- Edit bug report at http://bugs.php.net/?id=28711&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28711&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28711&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28711&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28711&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28711&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28711&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28711&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28711&r=support Expected behavior: http://bugs.php.net/fix.php?id=28711&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28711&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28711&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28711&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28711&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28711&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28711&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28711&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28711&r=float
