#37966 [NEW]: $_SERVER will be destroyed when auto_globals_jit is enabled

From: Date: Thu, 29 Jun 2006 21:06:12 +0000
Subject: #37966 [NEW]: $_SERVER will be destroyed when auto_globals_jit is enabled
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98960@lists.php.net to get a copy of this message
From: sy at go2panel dot com Operating system: Redhat EL 4.0 PHP version: 5.1.4 PHP Bug Type: Variables related Bug description: $_SERVER will be destroyed when auto_globals_jit is enabled Description: ------------ auto_globals_jit will not initialize $_SERVER if $_ENV and $_COOKIE is accessed before any access to $_SERVER. This relates to setting cookie to browser. A few times refresh may be required to reproduce. These have been reproduced using Mozilla Firefox and MS Internet Explorer, latest versions available when this is posted. Modules /php -m [PHP Modules] bcmath bz2 calendar ctype date dba dbase dom exif ftp gd hash iconv libxml mbstring mysql openssl pcntl pcre PDO posix Reflection session SimpleXML soap sockets SPL SQLite standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zlib [Zend Modules] NONE Reproduce code: --------------- <?php # # (c) GO2PANEL Corporation # sy go2panel com # BUG CASE // If all lines are commented, $_SERVER array will not be generated (BUG) // If any line is uncommented, $_SERVER array will be generated (EXPECTED) //$a = var_export($_SERVER, TRUE); //if (isset($_SERVER)) TRUE; //$b = $_SERVER['SERVER_NAME']; $_COOKIE['say'] = 'hi'; $H = $_ENV['HTTP_HOST']; var_dump($_SERVER); ?> Expected result: ---------------- array(49) { ["FCGI_ROLE"]=> string(9) "RESPONDER" ["REDIRECT_SCRIPT_URL"]=> string(6) "/b.php" ["REDIRECT_SCRIPT_URI"]=> string(27) "http://somehost/b.php" ["REDIRECT_REMOTE_USER"]=> string(0) "" ["REDIRECT_STATUS"]=> string(3) "200" ["SCRIPT_URL"]=> string(6) "/b.php" ["SCRIPT_URI"]=> string(27) "http://somehost/b.php" ["REMOTE_USER"]=> string(0) "" ["HTTP_HOST"]=> string(14) "somehost" ... Actual result: -------------- array(2) { ["PHP_SELF"]=> string(6) "/b.php" ["REQUEST_TIME"]=> int(1151614513) } -- Edit bug report at http://bugs.php.net/?id=37966&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37966&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37966&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37966&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37966&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37966&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37966&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37966&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37966&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37966&r=support Expected behavior: http://bugs.php.net/fix.php?id=37966&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37966&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37966&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37966&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37966&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37966&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37966&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37966&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37966&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37966&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37966&r=mysqlcfg

« previous php.bugs (#98960) next »