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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
20 + 23 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 21:01:29 2024 UTC