|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-29 10:56 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
Description: ------------ filter_var() design is broken... the following code always returns FALSE: filter_var() obviously needs two outputs: the filtered value and a success/failure code. ($value, $errcode) = filter_var(... Reproduce code: --------------- $myint = "0"; if (!filter_var($myint, FILTER_VALIDATE_INT)) { echo "$myint is not an integer\n"; } else { echo "$myint is an integer\n"; } Expected result: ---------------- 0 is an integer Actual result: -------------- 0 is not an integer