Edit report at https://bugs.php.net/bug.php?id=61723&edit=1

 ID:                 61723
 Updated by:         ras...@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] larue...@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] ahar...@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] larue...@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

Reply via email to