Bug #66277 [NEW]: Unable to compare two strings that should be equal

From: Date: Thu, 12 Dec 2013 15:56:42 +0000
Subject: Bug #66277 [NEW]: Unable to compare two strings that should be equal
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183267@lists.php.net to get a copy of this message
From: mcgee dot will at gmail dot com Operating system: Windows Server 2012 R2 PHP version: 5.5.6 Package: Strings related Bug Type: Bug Bug description:Unable to compare two strings that should be equal Description: ------------ Server: Windows Server 2012 R2 Web Server: IIS 8.5 I am having an issue comparing two strings inside an IF statement. When I use var_dump to print out both string values this is what I get: string(16) "Exceptiontrace" string(14) "Exceptiontrace" As far as I can tell they both equal the same value but for some reason the top one is equal to string(16) instead of 14 as would be expected. The value is generated by calling get_defined_vars() after catching an exception. NOTE: $x may need to be adjusted to target the Exceptiontrace object Test script: --------------- Source View: http://www.wil-tec.com/src/test.html Actual Script: http://www.wil-tec.com/src/test.php Expected result: ---------------- I expect php to execute either A or B, but not C A. die("I should be only Value Printed"); Line: 36 B. die("Or If that doesnt work I should be."); Line: 37 C. die('But i actually am the last and key does = "' . $key . '"'); Line: 46 Actual result: -------------- php ends up executing C and the output looks like: [START OUTPUT] string(16) "Exceptiontrace" string(14) "Exceptiontrace" But i actually am the last and key does = "Exceptiontrace" [END OUTPUT] -- Edit bug report at https://bugs.php.net/bug.php?id=66277&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66277&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66277&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66277&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66277&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66277&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66277&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66277&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66277&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66277&r=support Expected behavior: https://bugs.php.net/fix.php?id=66277&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66277&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66277&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66277&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66277&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66277&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66277&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66277&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66277&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66277&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66277&r=mysqlcfg

« previous php.bugs (#183267) next »