From:             adamaflynn at thousandmonkeys dot net
Operating system: Linux
PHP version:      5.1.2
PHP Bug Type:     Scripting Engine problem
Bug description:  Odd Unexpected T_ELSE

Description:
------------
I'm getting a weird error in PHP 5.1.2. When I run XMB Forum, I get a
parse error saying unexpected T_ELSE when there is no reason that there
should be an unexpected T_ELSE.

I had the issue yesterday, and, after discovering that my php.ini wasn't
in the right path and fixing that, it fixed itself. Now again today I'm
running into the bug. So, I'm assuming the issue is with PHP and not the
code I'm using.

My ./configure line is:
'./configure' '--with-apxs=/usr/local/apache/bin/apxs'
'--with-config-file-path=/etc/' '--disable-short-tags' '--with-zlib'
'--enable-bcmath' '--with-bz2' '--enable-calendar' '--with-curl'
'--with-ftp' '--with-gd' '--with-mysql=/var/lib/mysql' '--with-mysqli'
'--enable-sockets' '--without-sqlite'

Reproduce code:
---------------
    if (!$db->error()) {
        $count = $db->num_fields($resource);
        if ($header) {
            ?><tr class="category" bgcolor="<?php echo $altbg2;?>"
align="center"><?php
            for($i=0;$i<$count;$i++) {
                echo '<td align="left">';
                echo '<strong><font
color='.$cattext.'>'.$db->field_name($resource, $i).'</font></strong>';
                echo '</td>';
            }
            echo '</tr>';
        }

        while($a = $db->fetch_array($resource, SQL_NUM)) {
            ?><tr bgcolor="<?php echo $altbg1;?>"
class="ctrtablerow"><?php
            for($i=0;$i<$count;$i++) {
                echo '<td align="left">';

                if (trim($a[$i]) == '') {
                    echo '&nbsp;';
                }else{
                    echo nl2br($a[$i]);
                }
                echo '</td>';
            }
            echo '</tr>';
        }
    } else {
      error($db->error());
    }

Expected result:
----------------
I shouldn't get the unexpected T_ELSE error

Actual result:
--------------
I get the unexpected T_ELSE error.

-- 
Edit bug report at http://bugs.php.net/?id=36751&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=36751&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=36751&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=36751&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36751&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=36751&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36751&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36751&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36751&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36751&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36751&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=36751&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=36751&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36751&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36751&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36751&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36751&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36751&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36751&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36751&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36751&r=mysqlcfg

Reply via email to