note 118383 added to filter.filters.validate

From: Date: Wed, 25 Nov 2015 17:18:05 +0000
Subject: note 118383 added to filter.filters.validate
Groups: php.notes 
Request: Send a blank email to php-notes+get-204230@lists.php.net to get a copy of this message
Note that if using FILTER_NULL_ON_FAILURE as a flag with the FILTER_VALIDATE_BOOLEAN id then NULL is no longer returned if the variable name is not set in the external variable array. It will instead return FALSE. In the description is says that when using the FILTER_NULL_ON_FAILURE flag that ' FALSE is returned only for "0", "false", "off", "no", and ""' an makes no mention of this additional state that can also return false. The behavior is mentioned on the filter_input documentation page under Return Values but that is not overly helpful if one is just looking here. If FILTER_NULL_ON_FAILURE is not used then NULL is returned when the variable name is not set in the external variable array, TRUE is returned for "1", "true", "on" and "yes" and FALSE is returned for everything else. ---- Server IP: 72.52.91.14 Probable Submitter: 144.47.201.14 ---- Manual Page -- http://php.net/manual/en/filter.filters.validate.php Edit -- https://master.php.net/note/edit/118383 Del: integrated -- https://master.php.net/note/delete/118383/integrated Del: useless -- https://master.php.net/note/delete/118383/useless Del: bad code -- https://master.php.net/note/delete/118383/bad+code Del: spam -- https://master.php.net/note/delete/118383/spam Del: non-english -- https://master.php.net/note/delete/118383/non-english Del: in docs -- https://master.php.net/note/delete/118383/in+docs Del: other reasons-- https://master.php.net/note/delete/118383 Reject -- https://master.php.net/note/reject/118383 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204230) next »