Re: Request for comment

From: Date: Thu, 10 Aug 2000 22:21:56 +0000
Subject: Re: Request for comment
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-28519@lists.php.net to get a copy of this message
What happened here is that $b was effected by the traversing of $a where it shouldn't have. I have fixed this. What also works is foreach(array(1,2,3 as $ka => $va) The main problem is with weird expressions in foreach such as foreach($a=$b) which would still have such side effect issues. I think this code is obscure and the change of people using it is slim. I would like to change foreach to only support: a) foreach($var) where var could be any variable/multi-dimensionaly variable ($a[0]). b) foreach(array(....)) Does anyone see a problem with this? It would mean you can't put obscure stuff into foreach().
realized too late you already commented, I wouldn´t call it obscure, but if it isn´t possible one has to finish building/creating the array outside foreach(), shouldn´t be that much impact if we disallow anything but (a) and (b) you´re at topic now ;) , what about another feature request I´ve posted adding the ability to use statements like list foreach ($multidimarray AS list($key,$array2)) would simplify multi-dim array stuff 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 (#28519) next »