|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-04-16 20:05 UTC] yiwakiri at st dot rim dot or dot jp
Description:
------------
The results of comparison differ by Windows and unix.
Windows:
c:\> php -r "var_dump(('0d1' == '0d2'));"
bool(true)
Unix like OS:
% php -r "var_dump(('0d1' == '0d2'));"
bool(false)
I expect the same behavior for both.
Reproduce code:
---------------
c:\> php -r "var_dump(('0d1' == '0d2'));"
Expected result:
----------------
bool(false)
Actual result:
--------------
bool(true)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 18:00:01 2025 UTC |
[Windows XP Pro SP1] D:\PHP>4.3.2\php-cli -r "var_dump(('0d1' == '0d2'));" bool(true) D:\PHP>4.3.3\php-cli -r "var_dump(('0d1' == '0d2'));" bool(true) D:\PHP>4.3.4\php-cli -r "var_dump(('0d1' == '0d2'));" bool(true) D:\PHP>4.3.6\php-cli -r "var_dump(('0d1' == '0d2'));" bool(true) D:\PHP>php4-win32-STABLE-latest\php-cli -r "var_dump(('0d1' == '0d2'));" bool(true) D:\PHP>php4-win32-STABLE-latest\php-cli -v PHP 4.3.7-dev (cli) (built: Apr 17 2004 14:18:37) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies [Linux 2.6.5] hs@test:~/compile/php-4.3.6% sapi/cli/php -r "var_dump(('0d1' == '0d2'));" bool(false)A snapshot is also the same behavior. C:\>php -v PHP 4.3.7-dev (cli) (built: Apr 17 2004 10:21:09) Copyright (c) 1997-2004 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies C:\>php -r "var_dump(('0d1' == '0d2'));" bool(true)Hmm, I'm confused. Windows(2k, XP 98): C:\>php -r "var_dump('0d1' == '0d2');" (1) bool(true) C:\>php -r "var_dump('00d1' == '00d2');" (2) bool(false) C:\>php -r "var_dump('0a1' == '0a2');" (3) bool(false) Unix like OS: % php -r "var_dump('0d1' == '0d2');" (4) bool(false) % php -r "var_dump('0a1' == '0a2');" (5) bool(false) Only (1) does not bring a result to expect.