Req #40832 [Opn->Bgs]: Behavior of PI end in single-line comment
| From: | johannes@php.net | Date: | Wed, 22 Dec 2010 12:21:12 +0000 |
| Subject: | Req #40832 [Opn->Bgs]: Behavior of PI end in single-line comment | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157224@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=40832&edit=1
ID: 40832
Updated by: johannes@php.net
Reported by: josh dot helzer at gmail dot com
Summary: Behavior of PI end in single-line comment
-Status: Open
+Status: Bogus
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: Linux 2.4.26-gentoo-r7
PHP Version: 5.2.1
Block user comment: N
Private report: N
New Comment:
The behavior is needed to allow using single line comments while
embedding PHP in HTML like in
<h1><?php echio $title; // comment ?></h1>
Your compromise won't work as it break valid code like
<?php if ($cond) { ?><h1>TRUE</h1><?php } ?>
Previous Comments:
------------------------------------------------------------------------
[2007-03-16 02:15:17] josh dot helzer at gmail dot com
Description:
------------
When a processing instruction end (PIE), i.e., "?>", is encountered in a
single-line comment, the PHP parser should handle it more intelligently,
thus:
If the PIE would, when outside single-line comment context (SLCC), not
mark the end of the current PHP code block (e.g., if it occurred inside
a string literal), it should not, when inside SLCC, mark the end of the
code block.
---
The above represents a compromise suggestion. I feel the semantics of
comments ought to be the same as those in, e.g., C, Perl; i.e., comment
text should be naively stripped from the input stream seen by the
parser.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=40832&edit=1