Re[4]: [PHP] nested, referenced foreach & implicit current array pointer issues
| From: | speedy | Date: | Wed, 31 Jan 2007 16:35:02 +0000 |
| Subject: | Re[4]: [PHP] nested, referenced foreach & implicit current array pointer issues | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-248092@lists.php.net to get a copy of this message | ||
Hello Martin,
Wednesday, January 31, 2007, 4:50:22 PM, you wrote:
> There is nothing wrong with the global keyword, just use $GLOBAL
> ['arr'] instead to avoid the reference, or create a copy by
> assignment.
Yep, already did, 10x for the suggestion. :)
> Anyway, I couldn't find this change of behaviour in the foreach in
> the changelog, but it seems it have been introduced around may
> 2005. Maybe is too late to complain, but, now that I know, I think
> this behaviour doesn't seem right.
I'd rather see global being equal to $GLOBAL[] in combination with removal
of hidden current pointer from arrays. But I don't have much experience in
designing high-level languages nor did I give a lot of thought about it in the
global picture. :)
--
Best regards,
speedy mailto:speedy.spam@gmail.com