|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-23 04:29 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 18:00:01 2025 UTC |
Description: ------------ This is complicated, so I'll try explaining as best I can. There is a binary file. The first byte is 0x44. Doing a comparison (==) to 0x2C returns "TRUE" because 44 is the decimal for 0x2C. The decimal value of 0x44 is 68. This should return "FALSE" but does not. Reproduce code: --------------- (bin2hex("D") == 0x2C) RETURNS TRUE; SHOULD RETURN FALSE; (bin2hex("D") == 0x44) RETURNS FALSE; SHOULD RETURN TRUE; (bin2hex("D") == 44) RETURNS TRUE; SHOULD RETURN TRUE; Expected result: ---------------- print(bin2hex("D") == 0x2C) //prints nothing print(bin2hex("D") == 0x44) //prints '1' print(bin2hex("D") == 44) //prints '1' Actual result: -------------- print(bin2hex("D") == 0x2C) //prints '1' print(bin2hex("D") == 0x44) //prints nothing print(bin2hex("D") == 44) //prints '1'