#28031 [Com]: Results of comparison differ by Windows and unix.

2004-04-19 Thread postings-php-bug at hans-spath dot de
 ID:   28031
 Comment by:   postings-php-bug at hans-spath dot de
 Reported By:  yiwakiri at st dot rim dot or dot jp
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Windows 2k, XP, 98
 PHP Version:  4.3.6, 4.3.7-dev
 New Comment:

D:\PHPver
Microsoft Windows XP [Version 5.1.2600]

D:\PHPlastest\php-cli -v
PHP 4.3.7-dev (cli) (built: Apr 19 2004 14:16:52)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

D:\PHP5.0.0RC1\php -v
PHP 5.0.0RC1 (cli) (built: Mar 18 2004 18:20:03)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.0RC1, Copyright (c) 1998-2004 Zend Technologies

D:\PHPlastest\php-cli test\string_comparison.php 0x1 0x2
( '0x1' == '0x2' ) = bool(false)
D:\PHPlastest\php-cli test\string_comparison.php 0d1 0d2
( '0d1' == '0d2' ) = bool(true)
D:\PHPlastest\php-cli test\string_comparison.php 0d1x 0d2x
( '0d1x' == '0d2x' ) = bool(false)
D:\PHPlastest\php-cli test\string_comparison.php 0d1 0dx1
( '0d1' == '0dx1' ) = bool(false)
D:\PHPlastest\php-cli test\string_comparison.php 0d1 0xd1
( '0d1' == '0xd1' ) = bool(true)
D:\PHPlastest\php-cli test\string_comparison.php 0d1 0xd2
( '0d1' == '0xd2' ) = bool(true)
D:\PHPlastest\php-cli test\string_comparison.php d1 xd2
( 'd1' == 'xd2' ) = bool(false)
D:\PHPlastest\php-cli test\string_comparison.php d1 xd1
( 'd1' == 'xd1' ) = bool(false)
D:\PHPlastest\php-cli test\string_comparison.php 0e9 0xe4
( '0e9' == '0xe4' ) = bool(true)

D:\PHP5.0.0RC1\php test\string_comparison.php 0e9 0xe4
( '0e9' == '0xe4' ) = bool(true)

I wonder why this hasn't been discovered before. All my currently
installed (win32) versions (4.3.[2346], 5.0.0RC1) suffer from this
problem.


Previous Comments:


[2004-04-19 10:34:31] yiwakiri at st dot rim dot or dot jp

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.



[2004-04-19 02:24:43] yiwakiri at st dot rim dot or dot jp

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)



[2004-04-17 15:24:52] postings-php-bug at hans-spath dot de

[Windows XP Pro SP1]

D:\PHP4.3.2\php-cli -r var_dump(('0d1' == '0d2'));
bool(true)
D:\PHP4.3.3\php-cli -r var_dump(('0d1' == '0d2'));
bool(true)
D:\PHP4.3.4\php-cli -r var_dump(('0d1' == '0d2'));
bool(true)
D:\PHP4.3.6\php-cli -r var_dump(('0d1' == '0d2'));
bool(true)

D:\PHPphp4-win32-STABLE-latest\php-cli -r var_dump(('0d1' ==
'0d2'));
bool(true)
D:\PHPphp4-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]

[EMAIL PROTECTED]:~/compile/php-4.3.6% sapi/cli/php -r var_dump(('0d1' ==
'0d2'));
bool(false)



[2004-04-17 10:54:04] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip





[2004-04-16 20:05:20] 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)





-- 
Edit this bug report at http://bugs.php.net/?id=28031edit=1


#28031 [Com]: Results of comparison differ by Windows and unix.

2004-04-17 Thread postings-php-bug at hans-spath dot de
 ID:   28031
 Comment by:   postings-php-bug at hans-spath dot de
 Reported By:  yiwakiri at st dot rim dot or dot jp
 Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: Windows 98
 PHP Version:  4.3.6
 New Comment:

[Windows XP Pro SP1]

D:\PHP4.3.2\php-cli -r var_dump(('0d1' == '0d2'));
bool(true)
D:\PHP4.3.3\php-cli -r var_dump(('0d1' == '0d2'));
bool(true)
D:\PHP4.3.4\php-cli -r var_dump(('0d1' == '0d2'));
bool(true)
D:\PHP4.3.6\php-cli -r var_dump(('0d1' == '0d2'));
bool(true)

D:\PHPphp4-win32-STABLE-latest\php-cli -r var_dump(('0d1' ==
'0d2'));
bool(true)
D:\PHPphp4-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]

[EMAIL PROTECTED]:~/compile/php-4.3.6% sapi/cli/php -r var_dump(('0d1' ==
'0d2'));
bool(false)


Previous Comments:


[2004-04-17 10:54:04] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip





[2004-04-16 20:05:20] 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)





-- 
Edit this bug report at http://bugs.php.net/?id=28031edit=1