From:             t dot noest at noestnet dot nl
Operating system: winnt
PHP version:      4.3.7
PHP Bug Type:     Scripting Engine problem
Bug description:  comment fails nested if, resulting in unexpected $end error

Description:
------------
Sometimes I get a "parse error, unexpected $end at [last line of my
script]"
I found when I add an extra "}" to my script (for wich there is not a
starting "{", I counted thorough!) it works!

So I cut my script down to the point I had a nested-if left and found that
adding a comment results in the error! Delete the comment and the script
works as expected!

This plagued me also with 4.3.6 and was the reason for me to upgrade, but
that didn't help. Both executables came from the distributed zip's. 



Reproduce code:
---------------
<?PHP
# File to point some strange PHP behaviour....

$a = 10;                 
$b = 100;
$c = true;
$d = false;
if ($d) {
        $test = true;
}else{
        if ($c) {
                echo "A<BR>\n";
                $e = $a;
        } else {
                echo "B<BR>\n";
                $e = $b;                # wreck it with this comment!
        }
}
?>
<HTML><BODY>Error Test</BODY></HTML>


Expected result:
----------------
A
Error Test 

Actual result:
--------------
Parse error: parse error, unexpected $end in E:\NoestNet\.....\error.php
on line 16


-- 
Edit bug report at http://bugs.php.net/?id=28853&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28853&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28853&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28853&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28853&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28853&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28853&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28853&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28853&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28853&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28853&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28853&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28853&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28853&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28853&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28853&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28853&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28853&r=float

Reply via email to