Req #63148 [Opn->Csd]: Pass array key to array_filter function callback

From: Date: Thu, 27 Aug 2015 21:49:56 +0000
Subject: Req #63148 [Opn->Csd]: Pass array key to array_filter function callback
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195572@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63148&edit=1

 ID:                 63148
 Updated by:         nikic@php.net
 Reported by:        hradtke@php.net
 Summary:            Pass array key to array_filter function callback
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            Arrays related
 PHP Version:        5.4Git-2012-09-24 (Git)
-Assigned To:        
+Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

Supported since 5.6 via the ARRAY_FILTER_USE_KEY and ARRAY_FILTER_USE_BOTH flags.


Previous Comments:
------------------------------------------------------------------------
[2012-09-25 09:52:17] laruence@php.net

the problem is not about consistent with other functions, the problem is do we 
really need this?

maybe you should write to internal ML, get some more disscussion? :)

thanks

------------------------------------------------------------------------
[2012-09-25 03:48:08] hradtke@php.net

Also, the other functions, such as http://php.net/array_map,
provide the key.

------------------------------------------------------------------------
[2012-09-25 03:07:11] hradtke@php.net

Everything that array_filter does can be done with a foreach loop though. Some 
people prefer the functional approach instead though.

------------------------------------------------------------------------
[2012-09-25 02:49:02] laruence@php.net

Hey, we have various array functions, and I do believe this can be done in another 
ways, 

so, why introduce this? thanks

------------------------------------------------------------------------
[2012-09-24 09:24:29] hradtke@php.net

PR: https://github.com/php/php-src/pull/202

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=63148


--
Edit this bug report at https://bugs.php.net/bug.php?id=63148&edit=1


Thread (7 messages)

« previous php.bugs (#195572) next »