#28200 [Opn->Bgs]: string comparing

From: Date: Wed, 28 Apr 2004 10:37:14 +0000
Subject: #28200 [Opn->Bgs]: string comparing
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58935@lists.php.net to get a copy of this message
ID: 28200 Updated by: derick@php.net Reported By: mikael dot suvi at trigger dot ee -Status: Open +Status: Bogus Bug Type: Strings related Operating System: Linux PHP Version: 4.3.5 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . Previous Comments: ------------------------------------------------------------------------ [2004-04-28 09:51:12] mikael dot suvi at trigger dot ee Description: ------------ By comparing strings that contain only numbers and are longer that certain length give strange results. When using === I get the correct results. Does that mean that when comparing strings one should use ONLY === and not ==. Reproduce code: --------------- <? $str = "1111111111111111111"; $str1 = "1111111111111111112"; if ($str == $str1) print "equal"; ?> Actual result: -------------- equal ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28200&edit=1

« previous php.bugs (#58935) next »