|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-06-29 21:11 UTC] tony2001@php.net
[2006-06-29 22:01 UTC] sy at go2panel dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 15:00:02 2025 UTC |
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) }