|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69189 Passing multiple callbacks to preg_replace_callback.
Submitted: 2015-03-04 22:47 UTC Modified: 2015-03-21 21:00 UTC
From: admin at azareal dot com Assigned: nikic (profile)
Status: Closed Package: PCRE related
PHP Version: master-Git-2015-03-04 (Git) OS: Any
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: admin at azareal dot com
New email:
PHP Version: OS:


 [2015-03-04 22:47 UTC] admin at azareal dot com
It would be nice, if it was possible to pass multiple callbacks to preg_replace_callback instead of just one. One possible method might be by placing them in an array.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-03-04 23:20 UTC] php at requinix dot net
But how would that work? The first callback takes an array of matches as an argument, returns a string for the replacement, then the second does... what?
Maybe you have an example in mind?
 [2015-03-05 04:52 UTC]
actually, I proposed something like that.. but it was declined

need looking for it in ML :<
 [2015-03-05 15:15 UTC]
no matter whatever you want you could wrapper them in the single callable.
 [2015-03-21 21:00 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2015-03-21 21:00 UTC]
Implemented now as described in the linked RFC.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Oct 26 12:03:35 2021 UTC