https://bugzilla.novell.com/show_bug.cgi?id=477555 Summary: php string comparison may give wrong result due to compiler issues Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: i686 OS/Version: openSUSE 11.1 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: max630@mail.ru QAContact: qa@suse.de Found By: --- User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.3) Gecko/2008092814 Iceweasel/3.0.3 (Debian-3.0.3-3) php comparison by operator "==" may give wrong false result if arguments are hexadecimal strings larger than suitable for int. This must caused by gcc compiler bug. Reproducible: Always Steps to Reproduce: 1. install php5-5.2.6-49.14.3 2. run shell command: $/usr/bin/php5 -r 'var_dump("0x83781640c48cf91507143973d2ed0616f7" == "0x83781640c48cf91507143973d2ed0616f7");' Actual Results: Output is: bool(false) Expected Results: Output is: bool(true) Heaxadecimal literals in strings do not fit in int, so they must be compared as strings, and they are the same. the function that causes the error is zendi_smart_strcmp(), Zend/zend_operators.c, about line 1962 If I rebuild php with optimisation flag -O1 (instead of default -O2), the comparison works ok. Likely to be a compiler error, but I cannot prove it, so posting it as PHP bug. the compiler version: $rpm -qf /usr/bin/gcc gcc-4.3-34.168 the same error was in opensuse 11.0 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.