note 52155 added to function.strstr

From: Date: Fri, 22 Apr 2005 13:45:37 +0000
Subject: note 52155 added to function.strstr
Groups: php.notes 
Request: Send a blank email to php-notes+get-88403@lists.php.net to get a copy of this message
Regarding the note left by nicolas at bougues dot net on 26-Sep-2002 11:53, where he stated > The following expression > > strstr ("0", "0") == FALSE > > is TRUE, which is obviously not what one's want when comparing to FALSE. > > If you just want to know iff haystack contains needle, without such ambiguity, use is_string > (strstr ("0", "0")), which will evaluate to TRUE. Use the === operator instead. Thus, str ("0", "0") === FALSE if FALSE as expected. ---- Manual Page -- http://www.php.net/manual/en/function.strstr.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+52155 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52155&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52155&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52155&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52155&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52155&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+52155&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#88403) next »