#29894 [Opn->Bgs]: $_SERVER['PHP_SELF'] behaviour changed
| From: | derick@php.net | Date: | Mon, 30 Aug 2004 11:08:03 +0000 |
| Subject: | #29894 [Opn->Bgs]: $_SERVER['PHP_SELF'] behaviour changed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-65457@lists.php.net to get a copy of this message | ||
ID: 29894
Updated by: derick@php.net
Reported By: jeanphilippe dot glomot at bnpparibas dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: RedHat Linux
PHP Version: 4.3.8
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
.
Previous Comments:
------------------------------------------------------------------------
[2004-08-30 12:36:15] jeanphilippe dot glomot at bnpparibas dot com
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 this bug report at http://bugs.php.net/?id=29894&edit=1