|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-04-22 17:00 UTC] dtajchreber@php.net
-Status: Open
+Status: Bogus
[2011-04-22 17:00 UTC] dtajchreber@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
Description: ------------ Whenever testing for a variable with the value false using is_bool inside a switch statement will return false instead of true. I have tested it with different php versions, it happened on all of them. Test script: --------------- echo phpversion(); $var = false; switch ($var) { case is_bool($var): echo "boolean"; break; case is_numeric($var): echo "number"; break; } if (is_bool($var)) echo "boolean"; elseif (is_numeric($var)) echo "number"; Expected result: ---------------- 5.3.4booleanboolean Actual result: -------------- 5.3.4numberboolean