Bug #62097 [NEW]: New behavior of string == has a compatibility problem
From:
Operating system: Gentoo Linux
PHP version: 5.4.4RC1
Package: Scripting Engine problem
Bug Type: Bug
Bug description:New behavior of string == has a compatibility problem
Description:
------------
The behavior of string comparison using == operator is changed in
https://github.com/php/php-src/commit/47db8a9aa19f6e17a1018becf9978315c79a1cb0
to fix bug #54547.
This change has a compatibility problem.
Before this change (PHP 5.4.3),
"01234" == "1234"
=> TRUE (OK)
"09223372036854775808" == "9223372036854775808"
=> TRUE (compared as float, but result is acceptable)
After change,
"01234" == "1234"
=> TRUE (OK)
"09223372036854775808" == "9223372036854775808"
=> FALSE (compared as string)
This behavior is not reasonable in that case.
New rule is not clear.
I think this change should be reverted, before release of 5.4.4.
Test script:
---------------
echo (("01234" == "1234") ? "true" : "false"),
"\n";
echo (("09223372036854775808" == "9223372036854775808") ? "true" :
"false"), "\n";
Expected result:
----------------
true
true
Actual result:
--------------
true
false
--
Edit bug report at https://bugs.php.net/bug.php?id=62097&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62097&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62097&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62097&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=62097&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62097&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=62097&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=62097&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=62097&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=62097&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=62097&r=support
Expected behavior: https://bugs.php.net/fix.php?id=62097&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=62097&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=62097&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=62097&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62097&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62097&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=62097&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=62097&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=62097&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=62097&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=62097&r=mysqlcfg
Thread (26 messages)
- kazuo at o-ishi dot jp
- cataphract@php.netBug #62097 [Opn->Wfx]: New behavior of string == has a compatibility problem
- cataphract@php.netBug #62097 [Wfx]: New behavior of string == has a compatibility problem
- kazuo at o-ishi dot jpBug #62097 [Com]: New behavior of string == has a compatibility problem
- kazuo at o-ishi dot jpBug #62097 [Com]: New behavior of string == has a compatibility problem
- cataphract@php.netBug #62097 [Wfx->Asn]: New behavior of string == has a compatibility problem
- cataphract@php.netBug #62097 [Asn]: New behavior of string == has a compatibility problem
- cataphract@php.netBug #62097 [Asn->Csd]: New behavior of string == has a compatibility problem
- kazuo at o-ishi dot jpBug #62097 [Csd->Asn]: New behavior of string == has a compatibility problem
- cataphract@php.netBug #62097 [Asn->Csd]: New behavior of string == has a compatibility problem
- kazuo at o-ishi dot jpBug #62097 [Csd->Asn]: New behavior of string == has a compatibility problem
- cataphract@php.netBug #62097 [Asn]: New behavior of string == has a compatibility problem
- stas@php.netBug #62097 [Asn->Fbk]: New behavior of string == has a compatibility problem
- kazuo at o-ishi dot jpBug #62097 [Fbk->Asn]: New behavior of string == has a compatibility problem
- stas@php.netBug #62097 [Asn]: New behavior of string == has a compatibility problem
- kazuo at o-ishi dot jpBug #62097 [Asn]: New behavior of string == has a compatibility problem
- stas@php.netBug #62097 [Asn->Fbk]: New behavior of string == has a compatibility problem
- kazuo at o-ishi dot jpBug #62097 [Fbk->Asn]: New behavior of string == has a compatibility problem
- kazuo at o-ishi dot jpBug #62097 [Asn]: New behavior of string == has a compatibility problem
- stas@php.netBug #62097 [Asn]: New behavior of string == has a compatibility problem
- kazuo at o-ishi dot jpBug #62097 [Asn]: New behavior of string == has a compatibility problem
- stas@php.netBug #62097 [Asn->Wfx]: New behavior of string == has a compatibility problem
- steve at home dot comBug #62097 [Com]: New behavior of string == has a compatibility problem
- stas@php.netBug #62097 [Wfx]: New behavior of string == has a compatibility problem
- hholzgra@php.netBug #62097 [Wfx]: New behavior of string == has a compatibility problem
- stas@php.netBug #62097 [Wfx->Csd]: New behavior of string == has a compatibility problem