Re: PHP 4.0 Bug #9794: array_keys resets the array pointer and can not be used when looping
| From: | Andrei Zmievski | Date: | Fri, 16 Mar 2001 19:50:11 +0000 |
| Subject: | Re: PHP 4.0 Bug #9794: array_keys resets the array pointer and can not be used when looping | ||
| References: | 1 2 3 4 5 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-49104@lists.php.net to get a copy of this message | ||
On Fri, 16 Mar 2001, Stig Venaas wrote:
> It seems like this is a common problem, I think perhaps most of the
> PHP code (the C code) could be made cleaner if the Zend API separated
> pointers from the array structure. So that one could create a pointer
> and pass it as an argument to Zend hash functions, or something like
> that. It could be useful to have several pointers at once. One other
> option could be to have a pointer stack per hash, with two hash
> functions for pushing and popping the current pointer on/off the
> stack.
All this is already possible and has existed in Zend since exactly 1
year ago when I put it in... Extension authors can use *_ex versions of
hash functions and supply their own HashPosition parameter.
-Andrei
Documentation is worth it just to be able
to answer all your mail with 'RTFM'. -- Alan Cox