ID: 16112
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Bogus
+Status: Open
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.1.2
New Comment:
Here is code which demonstrates this flaw.
<html><head></head><body>
testing<br>
<?
$i =10;
if ($i==10) {
print ("haha i==$i!");
// commented line <?= $blah ?>
# commented line <?= $blah ?>
}
?>
</body>
</html>
My guess is PHP hits the closing ?> in the commented line and can't
tell the difference. This results in a missing brace issue which then
causes the compiler giving the following very non descript error
message:
Parse error: parse error in /var/www/blah.php on line 19
Of course there is no line 19 which leads me to believe it is simply a
missing brace. Checking all the braces doesn't do any good though
because they all are fine. The problem is that the closing ?> of
course messes everything up. I spent about 30 minutes trying to figure
out what I had done before I realized my error. I don't know if there
is an easy way to add a check for this kind of thing but clearly if a
programmer is putting ?> in comments something is wrong and maybe the
interpreter should give another error for that.
Previous Comments:
------------------------------------------------------------------------
[2002-03-16 06:24:17] [EMAIL PROTECTED]
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php
------------------------------------------------------------------------
[2002-03-15 23:28:19] [EMAIL PROTECTED]
a nicer parse error would be usefull for the error when you comment a
line that invokes <?php tags
// header("dfjdlkjfdlkjfld <?= $BLAH ?> )";
I know this isn't valid code because I'm already in <?php tags but
invoking <?= in a commented php line results in a parse error that
points to the line after the last level.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16112&edit=1