foreach limitation, arrays of arrays

From: Date: Sat, 22 Jul 2000 12:11:20 +0000
Subject: foreach limitation, arrays of arrays
Groups: php.dev 
Request: Send a blank email to php-dev+get-25408@lists.php.net to get a copy of this message
why can´t I use list() inside foreach(), playing around with arrays of arrays that´d avoid 1-2 lines code every foreach and avoid copying the array into a variable $arr=array('a'=>array('x'=>0,'y'=>1),'b'=>array('u'=>1,'j'=>2)); foreach ($arr AS $mainkey=>list($subkey,$array)) { print $value.$test; } or just foreach ($arr AS list($subkey,$array)) { print $value.$test; } It doesn´t make sense to allow anything within foreach, but list() is a statement that makes sense I think regards -- o----------0-¬---------O-·---¬----o---®-----o o O ° . | http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ ° · 0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ ° o © ° . · | psychedelic experience | gott@kiffen.de | O ° o ° o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·

« previous php.dev (#25408) next »