]> granicus.if.org Git - php/commitdiff
MFB
authorAndrei Zmievski <andrei@php.net>
Thu, 6 Apr 2006 21:16:28 +0000 (21:16 +0000)
committerAndrei Zmievski <andrei@php.net>
Thu, 6 Apr 2006 21:16:28 +0000 (21:16 +0000)
Zend/zend_arg_defs.c
Zend/zend_modules.h
ext/pcre/TODO [new file with mode: 0644]
ext/pcre/php_pcre.c

index a8483ff3af4f3153f120aa555479db7de74df623..721ca127f84f08e177fdd465c981c9b33e3e6a6f 100644 (file)
@@ -40,5 +40,13 @@ ZEND_BEGIN_ARG_INFO(fourth_arg_force_ref, 0)
        ZEND_ARG_PASS_INFO(1)
 ZEND_END_ARG_INFO();
 
+ZEND_BEGIN_ARG_INFO(fifth_arg_force_ref, 0)
+       ZEND_ARG_PASS_INFO(0)
+       ZEND_ARG_PASS_INFO(0)
+       ZEND_ARG_PASS_INFO(0)
+       ZEND_ARG_PASS_INFO(0)
+       ZEND_ARG_PASS_INFO(1)
+ZEND_END_ARG_INFO();
+
 ZEND_BEGIN_ARG_INFO(all_args_by_ref, 1)
 ZEND_END_ARG_INFO();
index 8a0c0929727f4fb59693a8ace41ee913b10763ff..12f61d9441b7483e0d3ceb7207ff6a42d4ab611f 100644 (file)
@@ -36,6 +36,7 @@ extern struct _zend_arg_info first_arg_force_ref[2];
 extern struct _zend_arg_info second_arg_force_ref[3];
 extern struct _zend_arg_info third_arg_force_ref[4];
 extern struct _zend_arg_info fourth_arg_force_ref[5];
+extern struct _zend_arg_info fifth_arg_force_ref[6];
 extern struct _zend_arg_info all_args_by_ref[1];
 
 #define ZEND_MODULE_API_NO 20050922
diff --git a/ext/pcre/TODO b/ext/pcre/TODO
new file mode 100644 (file)
index 0000000..1c596c0
--- /dev/null
@@ -0,0 +1,21 @@
+- Allow NULL for $matches argument (helps when using preg_match only for
+  match condition) - might not be possible
+
+- http://bugs.php.net/bug.php?id=36975
+
+- I'd love to see a pattern modifer which says "don't fill $matches except
+  for the overall match and any specific named captures". This would allow
+  (?: ...) to be avoided in a lot of cases.
+  
+  This could make for non-trivial speed enhancements with regexes that have
+  a lot of parens when working on long strings, since you'd not have to  
+  copy them multiple times to the $matches array.
+  
+  Also, it makes $matches much cleaner after a match where you've named the
+  captures you're interested in.
+  
+  (Note that this would not involve the use of PCRE_NO_AUTO_CAPTURE, as
+  that would change the semantics of backreferences)
+
+
+
index 7fe4d2407805e5cdc497376db7f9613673859eba..01a0f5dcd4d5a7b08f40ec863ff4e3a23acc629c 100644 (file)
@@ -1626,8 +1626,8 @@ PHP_FUNCTION(preg_grep)
 zend_function_entry pcre_functions[] = {
        PHP_FE(preg_match,                              third_arg_force_ref)
        PHP_FE(preg_match_all,                  third_arg_force_ref)
-       PHP_FE(preg_replace,                    NULL)
-       PHP_FE(preg_replace_callback,   NULL)
+       PHP_FE(preg_replace,                    fifth_arg_force_ref)
+       PHP_FE(preg_replace_callback,   fifth_arg_force_ref)
        PHP_FE(preg_split,                              NULL)
        PHP_FE(preg_quote,                              NULL)
        PHP_FE(preg_grep,                               NULL)