|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #33767 array_filter: support for additional callback arguments
Submitted: 2005-07-19 10:54 UTC Modified: 2016-03-27 20:37 UTC
Avg. Score:3.6 ± 1.6
Reproduced:7 of 8 (87.5%)
Same Version:1 (14.3%)
Same OS:1 (14.3%)
From: tjerk dot meesters at gmail dot com Assigned: nikic (profile)
Status: Closed Package: *General Issues
PHP Version: 5.1.0b3 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: tjerk dot meesters at gmail dot com
New email:
PHP Version: OS:


 [2005-07-19 10:54 UTC] tjerk dot meesters at gmail dot com
It would be desirable to add arguments to the callback function during the execution of array_filter(), like so:


function filterMPEG($line,$extra)
    return preg_match("#Codec {$extra}#",$line);

$a = array('Filter Low Pass','Codec MP2','Codec MP4');

// output MPEG2 codecs
// output MPEG4 codecs



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-03-27 20:37 UTC]
-Status: Open +Status: Closed -Package: Feature/Change Request +Package: *General Issues -Assigned To: +Assigned To: nikic
 [2016-03-27 20:37 UTC]
This is covered in a more general way by closures introduced in PHP 5.3.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 07:01:27 2024 UTC