[doc-en] master: filter: version the FILTER_CALLBACK flags note (#5243)
| From: | Louis-Arnaud via GitHub | Date: | Fri, 21 Aug 2026 08:38:16 +0000 |
| Subject: | [doc-en] master: filter: version the FILTER_CALLBACK flags note (#5243) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23599@lists.php.net to get a copy of this message | ||
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-08-21T10:38:13+02:00
Commit: https://github.com/php/doc-en/commit/1900175b061e4de78f5ba3e79874e457d7e710a1
Raw diff: https://github.com/php/doc-en/commit/1900175b061e4de78f5ba3e79874e457d7e710a1.diff
filter: version the FILTER_CALLBACK flags note (#5243)
Changed paths:
M reference/filter/constants.xml
Diff:
diff --git a/reference/filter/constants.xml b/reference/filter/constants.xml
index 88bd5bb64281..2c1555fc4d7c 100644
--- a/reference/filter/constants.xml
+++ b/reference/filter/constants.xml
@@ -720,9 +720,9 @@
(<type>int</type>)
</term>
<listitem>
- <para>
+ <simpara>
Validates value as IP address.
- </para>
+ </simpara>
<variablelist xml:id="filter.constants.validation.ip.options">
<title>Available options</title>
<varlistentry>
@@ -1235,12 +1235,20 @@ NULL
]]>
</screen>
</example>
- <warning>
+ <note>
<simpara>
- This filter cannot be used with any other filter flags, e.g.
- <constant>FILTER_NULL_ON_FAILURE</constant>.
+ As of PHP 8.1.25 and 8.2.12, the structural flags
+ <constant>FILTER_REQUIRE_ARRAY</constant>,
+ <constant>FILTER_FORCE_ARRAY</constant> and
+ <constant>FILTER_REQUIRE_SCALAR</constant> apply to this filter, and
+ <constant>FILTER_NULL_ON_FAILURE</constant> changes how such a
+ structural failure is reported. In earlier versions all flags were
+ ignored. Filter specific flags are always ignored, and since the return
+ value of the callback is the result, the callback itself cannot fail: no
+ flag turns a <literal>false</literal> returned by the callback into
+ &null; or an exception.
</simpara>
- </warning>
+ </note>
</listitem>
</varlistentry>
</variablelist>