rfc:second_arg_to_preg_callback
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
rfc:second_arg_to_preg_callback [2013/05/04 13:44] – created laruence | rfc:second_arg_to_preg_callback [2025/04/03 13:08] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PHP RFC: Your Title Here ====== | + | ====== PHP RFC: Add an Second argument to callback of preg_replace_callback |
* Version: 1.0 | * Version: 1.0 | ||
* Date: 2013-05-04 | * Date: 2013-05-04 | ||
Line 24: | Line 24: | ||
) | ) | ||
..); | ..); | ||
+ | ?> | ||
</ | </ | ||
- | can not be easier convert to the " | ||
- | then I have to change it to something very ugly like(a real use case see: https:// | + | can not be easier convert to the " |
+ | |||
+ | then I have to change it to something very ugly like(a real use case see: https:// | ||
<code php> | <code php> | ||
Line 81: | Line 83: | ||
</ | </ | ||
- | for this idea, there some problems: | + | for this idea, there some problems: |
- | 1. you have to define various functions for different regex | + | 1. you have to define various functions for different regex |
- | 2. it's inefficient, | + | |
+ | 2. it's inefficient, | ||
===== Other Ideas ===== | ===== Other Ideas ===== | ||
Line 90: | Line 93: | ||
1. the reporter(# | 1. the reporter(# | ||
- | but it's can not be achieved, because(by ww dot galen at gmail dot com): | + | but it's can not be achieved, because(by ww dot galen at gmail dot com): |
- | | + | |
+ | " | ||
class A { | class A { | ||
Line 109: | Line 113: | ||
3. `$a-> | 3. `$a-> | ||
- | 2. Nikic suggest the first argument of preg_replace_callback accept array(" | + | 2. Nikic suggest the first argument of preg_replace_callback accept array(" |
| | ||
- | | + | but it can not be achieved either , because, thinking of: |
- | $regex = array(" | + | $regex = array(" |
+ | |||
+ | |||
+ | ===== Patch ====== | ||
+ | The patch for this change is here: https:// | ||
| | ||
| | ||
| |
rfc/second_arg_to_preg_callback.1367675052.txt.gz · Last modified: 2025/04/03 13:08 (external edit)