Bug #61723 [Ver->Nab]: <?php issues a parse error
| From: | rasmus@php.net | Date: | Sat, 14 Apr 2012 04:45:42 +0000 |
| Subject: | Bug #61723 [Ver->Nab]: <?php issues a parse error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-169588@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61723&edit=1
ID: 61723
Updated by: rasmus@php.net
Reported by: lgandras at gmail dot com
Summary: <?php issues a parse error
-Status: Verified
+Status: Not a bug
Type: Bug
Package: Scripting Engine problem
Operating System: Centos 6.2
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
<?php is an XML PI tag. The full grammar for the tag as defined by the spec is:
PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))?
'?>'
The PITarget in this case is 'php'. The 'S' in the grammar there means
whitespace. The first whitespace character signifies the end of the PITarget. If
you have no whitespace you do not have a valid PI tag.
Previous Comments:
------------------------------------------------------------------------
[2012-04-14 04:21:51] laruence@php.net
@aharvey ah, thanks, in that case, I would say, this is a rare usage, and a doc
will be okey.
------------------------------------------------------------------------
[2012-04-14 04:05:38] aharvey@php.net
I was able to. You have to be very careful not to have any whitespace after the <?
php â if your editor adds a newline (like vi), then that will cause it to be OK.
What I'm not so sure about is whether this is really a bug: the whitespace at the
end of the opening tag is really part of the opening tag, so it may just need a
documentation update to be clearer.
Parser people? What's our expectation here?
------------------------------------------------------------------------
[2012-04-14 03:34:15] laruence@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves.
A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc. If the script requires a
database to demonstrate the issue, please make sure it creates
all necessary tables, stored procedures etc.
Please avoid embedding huge scripts into the report.
I can not reproduce this.
------------------------------------------------------------------------
[2012-04-13 15:27:13] lgandras at gmail dot com
Description:
------------
"<?php" issues a parse error whereas "<?php " does not. php -r
"" is valid in the command line. this is an inconsistent behavior.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61723&edit=1