|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-01-14 21:30 UTC] bjori@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 12 22:00:02 2025 UTC |
Description: ------------ The 'switch' statement does not correctly handle the case where the switch value === null. Reproduce code: --------------- The following code should show "null", "true", "false": function testSwitch( $v ) { return $v; } function showResult( $r ) { $v = testSwitch( $r ); switch ($v) { case false: echo "false"; break; case null: echo "null"; break; case true: echo "true"; break; } echo "\n<br/>"; } showResult( null ); showResult( true ); showResult( false ); Expected result: ---------------- null true false Actual result: -------------- false true false