#18987 [Opn->Bgs]: PHP Engine parsing commented code
| From: | derick@php.net | Date: | Tue, 20 Aug 2002 18:51:10 +0000 |
| Subject: | #18987 [Opn->Bgs]: PHP Engine parsing commented code | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-17333@lists.php.net to get a copy of this message | ||
ID: 18987
Updated by: derick@php.net
Reported By: xilord@yahoo.com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows/Linux
PHP Version: 4.2.2
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2002-08-20 14:43:35] xilord@yahoo.com
Not necessarily.
If you enter this exact line of code:
// $patt = "/(^\s*<p[^>]*?>)|(<\/p>$)/i";
--------------------------*
The php engine parses out the ?> as the end of the PHP script block
(which isn't the case.) In my example, I'm using *? as the quantifier
minimizer then the ">". PHP sees "?>" and kills the script.
Your example doesn't have the ?> commented out. Granted it's not
frequent that you'd have this combination anywhere in your code, but in
this example it is happening.
Try doing this:
// ?>
And see what happens.
------------------------------------------------------------------------
[2002-08-20 14:31:18] nohn@php.net
So for example
<?php
echo("test<br>");
// echo("lala<br>");
echo("bubu<br>");
?>
gives out
test
lala
bubu
on your system?
------------------------------------------------------------------------
[2002-08-20 13:56:35] xilord@yahoo.com
"Your problem does not imply a bug in PHP itself."
I'm not sure if I'm wrong in saying this, but last I checked, commented
code should never be parsed by any compiler/runtime. The fact that PHP
is reading the commented code implies a parsing issue.
If I'm incorrect in saying this, please let me know.
------------------------------------------------------------------------
[2002-08-20 12:03:55] edink@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2002-08-20 12:02:32] xilord@yahoo.com
Can duplicate on Windows 2k and Linux
// $patt = "/(^\s*<p[^>]*?>)|(<\/p>$)/i";
-------------------------}
PHP is parsing the commented code and closing the script block at the
"?>".
Haven't found anything on this issue in the Bug db. I know there are
obvious work-arounds but I thought I'd mention it.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18987&edit=1