From 309caed1121f73cb145104dd5470ac31d8977277 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Wed, 18 Feb 2026 11:32:12 +0100 Subject: [PATCH] Fix filter_input() return value documentation 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 --- reference/filter/functions/filter-input.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 @@ &reftitle.returnvalues; - On success returns the filtered variable. - If the variable is not set &false; is returned. - On failure &false; is returned, - unless the FILTER_NULL_ON_FAILURE 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 var_name variable is not set. + If the flag FILTER_NULL_ON_FAILURE is used, + it returns &false; if the variable is not set + and &null; if the filter fails.