Bug #66277 [Opn]: Unable to compare two strings that should be equal
| From: | wmcgee at driverpipeline dot com | Date: | Thu, 12 Dec 2013 16:02:23 +0000 |
| Subject: | Bug #66277 [Opn]: Unable to compare two strings that should be equal | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183268@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66277&edit=1
ID: 66277
User updated by: wmcgee at driverpipeline dot com
Reported by: wmcgee at driverpipeline dot com
Summary: Unable to compare two strings that should be equal
Status: Open
Type: Bug
Package: Strings related
Operating System: Windows Server 2012 R2
-PHP Version: 5.5.6
+PHP Version: 5.5.3
Block user comment: N
Private report: N
New Comment:
Changed Email
And PHP version to 5.5.3
Previous Comments:
------------------------------------------------------------------------
[2013-12-12 15:56:41] wmcgee at driverpipeline dot com
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 this bug report at https://bugs.php.net/bug.php?id=66277&edit=1