Re: PHP 4.0 Bug #5270: Nested foreach() using a copy of the same array does not work properly.
| From: | Stanislav Malyshev | Date: | Thu, 29 Jun 2000 13:35:42 +0000 |
| Subject: | Re: PHP 4.0 Bug #5270: Nested foreach() using a copy of the same array does not work properly. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-22765@lists.php.net to get a copy of this message | ||
AZ>> Actually, recently there was some internal API functionality added that
AZ>> allows and array traversal command to not touch the internal array
AZ>> pointer. It would be possible to go through the code base and convert it
AZ>> to new functionality, but the question is whether that would be backward
AZ>> compatible.
I fear that won't help. The problem here is not that it moves the pointer,
the problem seems to be that both foreach's actually work on the same
array (because you do not modify it, so it tries to be "smart" and makes
second array copy of the first).
--
Stanislav Malyshev stas@zend.com
+972-3-6139665