Disturbing parsing problems

From: Date: Mon, 29 Jul 2002 16:19:50 +0000
Subject: Disturbing parsing problems
Groups: php.general 
Request: Send a blank email to php-general+get-110206@lists.php.net to get a copy of this message
I added a few number_format() statements to previously working code (not having changed any {}s ) and it started getting parse errors, 'unexpected t_if, expected t_while'. In other words, it thinks the do statement shown below has been closed, and wants to hear about the while part. I checked over the sets of braces about 10 times, but the only way to fix it ended up being to have an uneven number of braces - two close braces needed eliminating. I'm not going to post all the code unless it's necessary but here is the basic control structure. I've shown here what braces I commented out. All of the below is escaped in and out of HTML many times. PHP 4.2.2 on Windows 2000 Professional. Is this a bug, or have people experienced weird problems with braces before? Regards, Colin Teubner if (){ do { if (){ while () {} if () ; else if (); else ; } if () {} if () { if { } // } if () { if { } // } } while (); if() {} //(4x) }

« previous php.general (#110206) next »