Re: cvs: phpdoc /en/language control-structures.xml
| From: | Nuno Lopes | Date: | Wed, 14 Nov 2007 21:51:03 +0000 |
| Subject: | Re: cvs: phpdoc /en/language control-structures.xml | ||
| References: | 1 | Groups: | php.doc.cvs |
| Request: | Send a blank email to doc-cvs+get-387@lists.php.net to get a copy of this message | ||
Ok, I'm convinced :)
Nuno
----- Original Message -----
First of all, the description in place was incorrect (or at least not complete), foreach's behavior on array pointer cannot be described in a few lines as it implies too much magic, it depends whether the array itself is used (and how it's used) inside the foreach or not, as foreach will do some optimization if it's not. $array = array(0,1,2,3); foreach($array as $a){} var_dump(key($array)); // NULL, as described in the doc however: $array = array(0,1,2,3); foreach($array as $a){ current($array); } var_dump(key($array)); // int(1); the pointer in such cases is only moved once. Worse: $array = array(0,1,2,3); foreach($array as $a){ $c = $array; } var_dump(key($array)); // int(0); here it's not moved. Increasing the complexity of the doc about a subject that is quite depreciated (array pointers) seemed not worth the trouble. The typo is fixed though, thanks for the hintI don't understand how your "fix" is better than the wording that wasthere.It was much more explicit for those who want to know what's going on. Anyway, you have a typo in your commit (effets).Nuno-- Etienne Kneuss http://www.colder.ch Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal