Fix bug #63148: Pass key to array_filter callback #202

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

hjr3 commented Sep 24, 2012

Added an optional parameter to array_filter to pass the array key to the
callback. Added test cases to prove it is working. Fixed a very minor
regression in ext/standard/tests/array/array_filter_error.phpt where the
test was expecting a warning if 3 parameters were passed to the
array_filter function.

Fix bug #63148: Pass key to array_filter callback
Added an optional parameter to array_filter to pass the array key to the
callback. Added test cases to prove it is working. Fixed a very minor
regression in ext/standard/tests/array/array_filter_error.phpt where the
test was expecting a warning if 3 parameters were passed to the
array_filter function.

here might be a segfault? since you didn't intialized key in it's declaration.

should be proto array array_filter(array input [, mixed callback [, bool pass_key]]

and might be a leak, the key will not clean if the zend_call_function call fails

Comment on behalf of lstrojny at php.net:

No feedback for a long time, closing.

@php-pulls php-pulls closed this Jan 6, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment