[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/reference/pcre/functions/_preg-replace-callback-array.xml_
From:       Christoph_Michael_Becker <cmb () php ! net>
Date:       2020-05-23 15:01:09
Message-ID: svn-cmb-1590246069-349965-1023692643 () svn ! php ! net
[Download RAW message or body]

cmb                                      Sat, 23 May 2020 15:01:09 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=349965

Log:
PHP 7.4: PCRE: document new $flags param for preg_replace_callback[_array]()

The PHP 7.4 `$flags` parameter as added to the `preg_replace_callback()` and \
`preg_replace_callback_array()` function was not yet included in the documentation.

In this PR, I'm
* Adding the parameter to the function signature.
* Adding minimal parameter documentation with a reference to the more detailed \
explanation in the parameter documentation of the \
                [`preg_match()`](https://www.php.net/manual/en/function.preg-match.php) \
                function.
* Adding a changelog entry for the parameter to each function.

Refs:
* https://github.com/php/php-src/pull/3958
* https://github.com/php/php-src/blob/2f1398dad934086b605073c51af3118c8eff28b1/UPGRADING#L304-L308


Patch contributed by jrfnl.

Changed paths:
    U   phpdoc/en/trunk/reference/pcre/functions/preg-replace-callback-array.xml
    U   phpdoc/en/trunk/reference/pcre/functions/preg-replace-callback.xml

Modified: phpdoc/en/trunk/reference/pcre/functions/preg-replace-callback-array.xml
===================================================================
--- phpdoc/en/trunk/reference/pcre/functions/preg-replace-callback-array.xml	2020-05-23 \
                14:38:33 UTC (rev 349964)
+++ phpdoc/en/trunk/reference/pcre/functions/preg-replace-callback-array.xml	2020-05-23 \
15:01:09 UTC (rev 349965) @@ -14,6 +14,7 @@
    <methodparam><type>mixed</type><parameter>subject</parameter></methodparam>
    <methodparam choice="opt"><type>int</type><parameter>limit</parameter><initializer>-1</initializer></methodparam>
  <methodparam choice="opt"><type>int</type><parameter \
role="reference">count</parameter></methodparam> +   <methodparam \
choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
  </methodsynopsis>
   <para>
    The behavior of this function is similar to
@@ -61,6 +62,18 @@
       </para>
      </listitem>
     </varlistentry>
+    <varlistentry>
+     <term><parameter>flags</parameter></term>
+     <listitem>
+      <para>
+       <parameter>flags</parameter> can be a combination of the
+       <constant>PREG_OFFSET_CAPTURE</constant> and
+       <constant>PREG_UNMATCHED_AS_NULL</constant> flags, which influence the
+       format of the matches array.
+       See the description in <function>preg_match</function> for more details.
+      </para>
+     </listitem>
+    </varlistentry>
    </variablelist>
   </para>
  </refsect1>
@@ -78,6 +91,30 @@
   </para>
  </refsect1>

+ <refsect1 role="changelog">
+  &reftitle.changelog;
+  <para>
+   <informaltable>
+    <tgroup cols="2">
+     <thead>
+      <row>
+       <entry>&Version;</entry>
+       <entry>&Description;</entry>
+      </row>
+     </thead>
+     <tbody>
+      <row>
+       <entry>7.4.0</entry>
+       <entry>
+        The <parameter>flags</parameter> parameter was added.
+       </entry>
+      </row>
+     </tbody>
+    </tgroup>
+   </informaltable>
+  </para>
+ </refsect1>
+
  <refsect1 role="examples">
   &reftitle.examples;
   <para>

Modified: phpdoc/en/trunk/reference/pcre/functions/preg-replace-callback.xml
===================================================================
--- phpdoc/en/trunk/reference/pcre/functions/preg-replace-callback.xml	2020-05-23 \
                14:38:33 UTC (rev 349964)
+++ phpdoc/en/trunk/reference/pcre/functions/preg-replace-callback.xml	2020-05-23 \
15:01:09 UTC (rev 349965) @@ -15,6 +15,7 @@
    <methodparam><type>mixed</type><parameter>subject</parameter></methodparam>
    <methodparam choice="opt"><type>int</type><parameter>limit</parameter><initializer>-1</initializer></methodparam>
  <methodparam choice="opt"><type>int</type><parameter \
role="reference">count</parameter></methodparam> +   <methodparam \
choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
  </methodsynopsis>
   <para>
    The behavior of this function is almost identical to
@@ -64,7 +65,7 @@
       </para>
       <para>
        <example>
-        <title><function>preg_replace_callback</function> and
+        <title><function>preg_replace_callback</function> and
         anonymous function</title>
         <programlisting role="php">
 <![CDATA[
@@ -118,6 +119,18 @@
       </para>
      </listitem>
     </varlistentry>
+    <varlistentry>
+     <term><parameter>flags</parameter></term>
+     <listitem>
+      <para>
+       <parameter>flags</parameter> can be a combination of the
+       <constant>PREG_OFFSET_CAPTURE</constant> and
+       <constant>PREG_UNMATCHED_AS_NULL</constant> flags, which influence the
+       format of the matches array.
+       See the description in <function>preg_match</function> for more details.
+      </para>
+     </listitem>
+    </varlistentry>
    </variablelist>
   </para>
  </refsect1>
@@ -131,7 +144,7 @@
   </para>
   <para>
    If matches are found, the new subject will be returned, otherwise
-   <parameter>subject</parameter> will be returned unchanged.
+   <parameter>subject</parameter> will be returned unchanged.
   </para>
  </refsect1>

@@ -148,9 +161,15 @@
      </thead>
      <tbody>
       <row>
+       <entry>7.4.0</entry>
+       <entry>
+        The <parameter>flags</parameter> parameter was added.
+       </entry>
+      </row>
+      <row>
        <entry>5.1.0</entry>
        <entry>
-        The <parameter>count</parameter> parameter was added
+        The <parameter>count</parameter> parameter was added.
        </entry>
       </row>
      </tbody>



-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic