svn: /phpdoc/ja/trunk/reference/pcre/functions/ preg-replace-callback-array.xml preg-replace-callback.xml
[email protected] (Yoshinari Takaoka)
| Newsgroups | php.doc.ja |
|---|---|
| Message-ID | <[email protected]> |
mumumu Sun, 24 May 2020 09:14:56 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=349970
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:
UU phpdoc/ja/trunk/reference/pcre/functions/preg-replace-callback-array.xml
U phpdoc/ja/trunk/reference/pcre/functions/preg-replace-callback.xml
Modified: phpdoc/ja/trunk/reference/pcre/functions/preg-replace-callback-array.xml
===================================================================
--- phpdoc/ja/trunk/reference/pcre/functions/preg-replace-callback-array.xml 2020-05-24 09:03:52 UTC (rev 349969)
+++ phpdoc/ja/trunk/reference/pcre/functions/preg-replace-callback-array.xml 2020-05-24 09:14:56 UTC (rev 349970)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 337869 Maintainer: satoruyoshida Status: ready -->
+<!-- EN-Revision: 349965 Maintainer: satoruyoshida Status: ready -->
+<!-- Credits: mumumu -->
<refentry xml:id="function.preg-replace-callback-array" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>preg_replace_callback_array</refname>
@@ -15,6 +16,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>
この関数の動作は、<function>preg_replace_callback</function> に似ていますが、
@@ -61,6 +63,18 @@
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><parameter>flags</parameter></term>
+ <listitem>
+ <para>
+ <parameter>flags</parameter> には、
+ <constant>PREG_OFFSET_CAPTURE</constant> と
+ <constant>PREG_UNMATCHED_AS_NULL</constant> の組み合わせが指定できます。
+ これは matches 配列のフォーマットに影響します。
+ 詳細は <function>preg_match</function> 関数の説明を参照してください。
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</para>
</refsect1>
@@ -80,6 +94,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>
+ パラメータ <parameter>flags</parameter> が追加されました。
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ </para>
+ </refsect1>
+
<refsect1 role="examples">
&reftitle.examples;
<para>
Property changes on: phpdoc/ja/trunk/reference/pcre/functions/preg-replace-callback-array.xml
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
\ No newline at end of property
Modified: phpdoc/ja/trunk/reference/pcre/functions/preg-replace-callback.xml
===================================================================
--- phpdoc/ja/trunk/reference/pcre/functions/preg-replace-callback.xml 2020-05-24 09:03:52 UTC (rev 349969)
+++ phpdoc/ja/trunk/reference/pcre/functions/preg-replace-callback.xml 2020-05-24 09:14:56 UTC (rev 349970)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: 337413 Maintainer: takagi Status: ready -->
-<!-- Credits: hirokawa,haruki -->
+<!-- EN-Revision: 349965 Maintainer: takagi Status: ready -->
+<!-- Credits: hirokawa,haruki,mumumu -->
<refentry xml:id="function.preg-replace-callback" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>preg_replace_callback</refname>
@@ -17,6 +17,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>
この関数の動作は、ほぼ <function>preg_replace</function> と同じですが、
@@ -121,6 +122,18 @@
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><parameter>flags</parameter></term>
+ <listitem>
+ <para>
+ <parameter>flags</parameter> には、
+ <constant>PREG_OFFSET_CAPTURE</constant> と
+ <constant>PREG_UNMATCHED_AS_NULL</constant> の組み合わせが指定できます。
+ これは matches 配列のフォーマットに影響します。
+ 詳細は <function>preg_match</function> 関数の説明を参照してください。
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</para>
</refsect1>
@@ -153,6 +166,12 @@
</thead>
<tbody>
<row>
+ <entry>7.4.0</entry>
+ <entry>
+ パラメータ <parameter>flags</parameter> が追加されました。
+ </entry>
+ </row>
+ <row>
<entry>5.1.0</entry>
<entry>
パラメータ <parameter>count</parameter> が追加されました。