-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Add seek($array, $offset, $whence) #645
Conversation
Actually you could just remove these superfluous fetches from the HashTable: // for next(), similar code for reset()
while (offset > 0 && zend_hash_move_forward(array) == SUCCESS) {
--offset;
} |
@bwoebi Good point, I made that patch some time ago and didn't reevaluate the code :) |
Can one of the admins verify this patch? |
so far it's had a lukewarm reception in internals, which is why I didn't merge it yet. I'll bring it up again |
This is useful 👍 |
I meant the |
i am a foreniger , i am not understand what you say.sorry At 2015-08-03 14:48:51, "Márcio Almada" notifications@github.com wrote: I meant the SEEK_SET variation, more specifically. I don't really care for moving according to an offset. IMMO it makes more sense to make SEEK_SET the default behavior. — |
Relevant internals discussions: http://markmail.org/message/sczgritz5jcccnwh |
Since this PR is against a security fix only branch, and since it has merge conflicts, and would need to be different for a supported branch, I'm closing this PR. I've read the internals discussions and the feature seems some what contentious, so please take this action as encouragement to open a clean PR accompanied by an RFC and fresh internals discussion, so that we may gather consensus and move forward with the feature. |
This fixes bug 31375 .
It introduces
seek($array, $offset [, $whence = SEEK_CUR)
to perform a seek on an array. For example: