#18987 [Bgs]: PHP Engine parsing commented code

From: Date: Tue, 20 Aug 2002 19:21:12 +0000
Subject: #18987 [Bgs]: PHP Engine parsing commented code
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17334@lists.php.net to get a copy of this message
ID: 18987 User updated by: xilord@yahoo.com Reported By: xilord@yahoo.com Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows/Linux PHP Version: 4.2.2 New Comment: I found this in the documentation: "The "one-line" comment styles actually only comment to the end of the line or the current block of PHP code, whichever comes first." Looks like it answers my question, but the concern is still there. Thanks for the help. Previous Comments: ------------------------------------------------------------------------ [2002-08-20 14:51:10] derick@php.net 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 ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ 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 http://bugs.php.net/18987 -- Edit this bug report at http://bugs.php.net/?id=18987&edit=1

« previous php.bugs (#17334) next »