|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-30 13:08 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 09:00:01 2025 UTC |
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