Bug #10287 Updated: php parser error

From: Date: Mon, 16 Jul 2001 16:04:39 +0000
Subject: Bug #10287 Updated: php parser error
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-60111@lists.php.net to get a copy of this message
ID: 10287 Updated by: zeev Reported By: robert.samanek@post.cz Old Status: Open Status: Closed Bug Type: Scripting Engine problem Operating System: win nt + linux (debian) PHP Version: 4.0.4pl1 New Comment: This crash is fixed. Note, however, that it still doesn't behave in the way you seem to expect it to behave, due to precedence rules. if (list($ar1_val)=each($ar1)&&list($ar2_val)=each($ar2)) is equivalent to if (list($ar1_val) = (each($ar1)&&list($ar2_val)=each($ar2))) Previous Comments: ------------------------------------------------------------------------ [2001-04-11 08:25:06] robert.samanek@post.cz hi, i'm afraid i found (by chance :-) ) a parser error. look at this code: <? $ar1=array (1,2,3); $ar2=array (4,5,6); if(list($ar1_val)=each($ar1)&&list($ar2_val)=each($ar2)) echo "Ok"; else echo "Error"; ?> php simply hangs by parsing that (i tried it on both win and linux - last release, 4.0.4pl1). the cure is to add more parenthesis, like this: if((list($ar1_val)=each($ar1))&&(list($ar2_val)=each($ar2))) but anyway, php should not hang in the first case... bye ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=10287&edit=1

« previous php.dev (#60111) next »