Bug #14042: Comment inside if statement causes parse error

From: Date: Tue, 13 Nov 2001 16:47:41 +0000
Subject: Bug #14042: Comment inside if statement causes parse error
Groups: php.dev 
Request: Send a blank email to php-dev+get-70365@lists.php.net to get a copy of this message
From: mikedlr@tardis.ed.ac.uk Operating system: RedHat Linux 7.2 PHP version: 4.0.6 PHP Bug Type: Compile Failure Bug description: Comment inside if statement causes parse error If I run the following script <?php if (($rows < 1)) { echo "hi ho\n"; // echo "<table border=1 width=50%>"; } ?> In PHP 4.0.6 (on RedHat 7.2) then I get a parse error like so ------------------------------------------------------- X-Powered-By: PHP/4.0.6 Content-type: text/html <br> <b>Parse error</b>: parse error in <b>parsetest.php</b> on line <b>10</b><br> ------------------------------------------------------- Whereas if I run it on PHP 4.0.4 (from RedHat 7.1) I get success like so. ------------------------------------------------------- X-Powered-By: PHP/4.0.4pl1 Content-type: text/html hi ho ------------------------------------------------------- I would expect both to work okay. The problem goes away if I either delete the comment line or delete the if statement. I'll also report this at RedHat. This is not urgent for me since the work around is obvious (delete the comment line) and unlikely to have any serious effect on the efficiency of my program. However, I'll check back here to answer any further queries. Best Regards and thanks for all the support and help.. Michael De La Rue. -- Edit bug report at: http://bugs.php.net/?id=14042&edit=1

« previous php.dev (#70365) next »