ID: 37966 User updated by: sy at go2panel dot com Reported By: sy at go2panel dot com -Status: Feedback +Status: Closed Bug Type: Variables related Operating System: Redhat EL 4.0 PHP Version: 5.1.4 New Comment:
This bug CANNOT be reproduced PHP Version 5.2.0-dev dated 20060613 Previous Comments: ------------------------------------------------------------------------ [2006-06-29 21:11:08] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip ------------------------------------------------------------------------ [2006-06-29 21:06:12] sy at go2panel dot com 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 this bug report at http://bugs.php.net/?id=37966&edit=1