[PHP-DEV] Bug #10287 Updated: php parser error From: zeev <email protected>
Date: 07/16/01

ID: 10287
Updated by: zeev
Reported By: robert.samanek <email protected>
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 <email protected>

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

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>