Doc #61723 [Csd->ReO]: <?php issues a parse error
| From: | salathe@php.net | Date: | Sat, 14 Apr 2012 11:14:57 +0000 |
| Subject: | Doc #61723 [Csd->ReO]: <?php issues a parse error | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-8266@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: salathe@php.net
Reported by: lgandras at gmail dot com
Summary: <?php issues a parse error
-Status: Closed
+Status: Re-Opened
Type: Documentation Problem
Package: Documentation problem
Operating System: Centos 6.2
PHP Version: 5.3.10
Assigned To: aharvey
Block user comment: N
Private report: N
New Comment:
I don't think the doc changes reflect reality.
The behaviour is different with/without short_open_tag enabled.
I tried the following with 5.1.0, 5.2.0, 5.3.0 and 5.4.0.
With short_open_tag On:
A file containing only "<?php" issues a Parse Error (unexpected $end/end of
file) in all four versions. A file containing only "<?php " executes without
error in all four versions.
With short_open_tag Off:
A file containing only "<?php" prints that out, there is no Parse Error. A file
containing only "<?php " executes, as with short_open_tag on, without error in
all four versions.
The suggestion here would be to get rid of that paragraph in the docs and
mention that some form of whitespace is always needed after the long opening tag
to move into "PHP mode".
Previous Comments:
------------------------------------------------------------------------
[2012-04-14 07:04:31] aharvey@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
------------------------------------------------------------------------
[2012-04-14 07:04:05] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=325166
Log: Fix doc bug #61723 (<?php issues a parse error).
------------------------------------------------------------------------
[2012-04-14 04:59:11] aharvey@php.net
Reopening as a doc bug and assigning to myself -- we could be a little clearer
about this on the escaping from HTML manual page.
------------------------------------------------------------------------
[2012-04-14 04:45:42] rasmus@php.net
<?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.
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=61723
--
Edit this bug report at https://bugs.php.net/bug.php?id=61723&edit=1