On Fri, Mar 16, 2001 at 11:21:39AM -0600, Andrei Zmievski wrote:
> On Fri, 16 Mar 2001, Daniel Beckham wrote:
> > Awesome.  Are you planning to just fix the array_keys function, or will
> > there be a change as to how the array functions work with the array
> > pointers?
> 
> It'll be on a case-by-case basis. Some functions do need to move the
> pointers.

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.

A final option. It's easy for the C code using the Zend API to save the
hash key for the element that the pointer currently points to. If there
was a Zend function for setting the pointer (taking hash key as argument),
it would be easier for the PHP C code to save and restore the pointer.

Well, just some quick thoughts written down in a couple of minutes, there
might be better alternatives, but I think one should consider some general
ways of solving this problem.

Stig

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to