-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Judy::rewind() - undefined method? #11
Comments
The iterator method are implemented so a Judy object can be used in a foreach. The implementation is done overloading the zend_object_iterator. Methods are currently not exposed at the php level. I will look at exposing the missing methods. |
That would be appreciated, having a bit of trouble trying to use Judy w/ the SPL iterators & classes. Attempted to extend Judy w/ a class that implemented Iterator or IteratorAggregate, received error that it could not implement X interface. Additionally, Judy::next() definition may conflict w/ what's expected of Iterator, so that may be an issue... |
I've worked around it by building a class implementing Iterator, ArrayAccess, Countable, using Judy as a private property within. Would be quite awesome if my custom class were (at least partially) obsoleted by similar implementation in Judy ;-) If I knew C & had the time, I'd contribute |
I will definitely look into this. Depending on my schedule, I may be able to get something out by end of week. |
@orieg this means you are not implementing Iterator. You are providing iteration support only (and you should at least implement Traversable, which would advocate this support to userland code, and allow to wrap it in an IteratorIterator if a real Iterator is needed) |
Attempting to use rewind() w/ Judy 0.1.6, results in the error:
FatalErrorException: Error: Call to undefined method Judy::rewind()
Supposedly Judy implements Iterator, which requires rewind(), but it's not listed in the method list in the manual, and attempting to access rewind() results in an error.
So does Judy implement Iterator or not?
http://www.php.net/manual/en/class.judy.php < even shows here that Judy implements Iterator.
The text was updated successfully, but these errors were encountered: