Skip to content

Commit f7e68a1

Browse files
authored
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 #4361
1 parent d7d6dd6 commit f7e68a1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

reference/filter/functions/filter-input.xml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@
5757
<refsect1 role="returnvalues">
5858
&reftitle.returnvalues;
5959
<simpara>
60-
On success returns the filtered variable.
61-
If the variable is not set &false; is returned.
62-
On failure &false; is returned,
63-
unless the <constant>FILTER_NULL_ON_FAILURE</constant> flag is used,
64-
in which case &null; is returned.
60+
Value of the requested variable on success,
61+
&false; if the filter fails,
62+
or &null; if the <parameter>var_name</parameter> variable is not set.
63+
If the flag <constant>FILTER_NULL_ON_FAILURE</constant> is used,
64+
it returns &false; if the variable is not set
65+
and &null; if the filter fails.
6566
</simpara>
6667
</refsect1>
6768

0 commit comments

Comments
 (0)