[DOC-CVS] [doc-en] master: Fix filter_input() return value documentation (#5381)
[email protected] (Louis-Arnaud via GitHub) Mon, 20 Apr 2026 23:56:48 +0000
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Louis-Arnaud (lacatoire) Committer: GitHub (web-flow) Pusher: kamil-tekiela Date: 2026-04-21T00:56:46+01:00 Commit: https://github.com/php/doc-en/commit/f7e68a1a35d622977d1a1c2155795204243ec3f1 Raw diff: https://github.com/php/doc-en/commit/f7e68a1a35d622977d1a1c2155795204243ec3f1.diff Fix filter_input() return value documentation (#5381) filter_input() returns null (not false) when the variable is not set. Also clarify the FILTER_NULL_ON_FAILURE behavior which inverts the return values: false when not set, null on filter failure. Fixes php/doc-en#4361 Changed paths: M reference/filter/functions/filter-input.xml Diff: diff --git a/reference/filter/functions/filter-input.xml b/reference/filter/functions/filter-input.xml index 627d6745e415..26f69b40e954 100644 --- a/reference/filter/functions/filter-input.xml +++ b/reference/filter/functions/filter-input.xml @@ -57,11 +57,12 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <simpara> - On success returns the filtered variable. - If the variable is not set &false; is returned. - On failure &false; is returned, - unless the <constant>FILTER_NULL_ON_FAILURE</constant> flag is used, - in which case &null; is returned. + Value of the requested variable on success, + &false; if the filter fails, + or &null; if the <parameter>var_name</parameter> variable is not set. + If the flag <constant>FILTER_NULL_ON_FAILURE</constant> is used, + it returns &false; if the variable is not set + and &null; if the filter fails. </simpara> </refsect1>