#29894 [NEW]: $_SERVER['PHP_SELF'] behaviour changed

From: Date: Mon, 30 Aug 2004 10:36:16 +0000
Subject: #29894 [NEW]: $_SERVER['PHP_SELF'] behaviour changed
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65455@lists.php.net to get a copy of this message
From: jeanphilippe dot glomot at bnpparibas dot com Operating system: RedHat Linux PHP version: 4.3.8 PHP Bug Type: Scripting Engine problem Bug description: $_SERVER['PHP_SELF'] behaviour changed Description: ------------ I have upgraded PHP on Linux from 4.3.1 to 4.3.8 versions (the configuration remains the same) The following script ... echo "php_self is $_SERVER['PHP_SELF']"; ... was OK in 4.3.1 I got this error in 4.3.8 ... Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING It seems that $_SERVER['PHP_SELF'] has changed is type (?). If you try this code ... $code = '$_SERVER[\'PHP_SELF\']'; foreach(token_get_all($code) as $c) { if(is_array($c)) { print(token_name($c[0]) . ": '" . htmlentities($c[1]) . "'\n"); } else { print("$c\n"); } } In 4.3.1, you get ... T_INLINE_HTML: '$_SERVER['PHP_SELF']' With 4.3.8, you get ... T_VARIABLE: '$_SERVER' [ T_CONSTANT_ENCAPSED_STRING: ''PHP_SELF'' ] Any idea ? Reproduce code: --------------- # very (too much ?) simple ... echo "php_self is $_SERVER['PHP_SELF']"; Expected result: ---------------- php_self is /something/file.php Actual result: -------------- Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING -- Edit bug report at http://bugs.php.net/?id=29894&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29894&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=29894&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=29894&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=29894&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29894&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29894&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29894&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29894&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29894&r=support Expected behavior: http://bugs.php.net/fix.php?id=29894&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29894&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29894&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29894&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29894&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29894&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29894&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29894&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29894&r=float

« previous php.bugs (#65455) next »