php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: admin at azareal dot com
New email:
PHP Version: OS:

 

 [2015-03-04 22:47 UTC] admin at azareal dot com
Description:
------------
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.


Patches

Pull Requests

History

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] laruence@php.net
actually, I proposed something like that.. but it was declined

need looking for it in ML :<
 [2015-03-05 15:15 UTC] reeze@php.net
no matter whatever you want you could wrapper them in the single callable.
 [2015-03-21 21:00 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2015-03-21 21:00 UTC] nikic@php.net
Implemented now as described in the linked RFC.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 16:01:36 2025 UTC