On Tue, Jun 18, 2013 at 9:07 AM, Sherif Ramadan <theanomaly...@gmail.com>wrote: > > On Tue, Jun 18, 2013 at 10:58 AM, Levi Morrison > <morrison.l...@gmail.com>wrote: > >> >> I'm starting up a thread for discussion on Pull Request 287 >>> https://github.com/php/php-src/pull/287 (allowing array keys to be >>> passed >>> to the callback function of array_filter through a third optional boolean >>> argument). I would like to merge this into master and as discussed on IRC >>> it would probably be a good idea to startup a discussion and make sure >>> there aren't any objections or clarifications not yet voiced. >>> >>> The patch has no BC because the third argument is optional and defaults >>> to >>> false. Personally, I have always thought it would be a good idea to be >>> able >>> to get the keys into the array_filter callback since I've stumbled >>> across a >>> few scenarios where that would have made things easier. >>> >>> I'm not sure if there are any particular down sides to this option being >>> added, but none that I can find. It currently passes all tests in master >>> and works as expected. >>> >>> Thoughts, opinions, objections, concerns? >>> >>> >> It might be considered a BC break, but I really think we should drop the >> boolean argument; just have it pass the key as parameter 2 always. >> > > > See the discussion on github for that PR > https://github.com/php/php-src/pull/287#issuecomment-14175109 unfortunately > we can't do that as it will break lots of userspace code that might be > doing stuff like array_filter(['foo','','bar'], 'strlen') where strlen only > accepts a single argument and in those cases the result will be triggering > lots of warnings and failed code. >
If `strlen` can't handle extra parameters then I'd say *that* is a real problem, this PR aside.