|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-05-11 22:18 UTC] dtajchreber@php.net
-Status: Open
+Status: Bogus
[2010-05-11 22:18 UTC] dtajchreber@php.net
[2010-05-12 01:27 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 14:00:01 2025 UTC |
Description: ------------ if ("0080" == "80e0") echo "Smoking crack!"; I created a double octet coded character set. I'm using 4 hex to represent each character. I'm using a switch statement to get a token based on the value. The string "80e0" is incorrectly setting off the case "0080" statement. The strict comparison of === works as expected, but the switch uses a loose comparison. Test script: --------------- if ("0080" == "80e0") { echo "Too loose"; } else { echo "Just right"; } Expected result: ---------------- Just right Actual result: -------------- Too loose