note 90972 added to function.stripos
| From: | Anteaus at osu1 dot php dot net | Date: | Tue, 19 May 2009 08:00:02 +0000 |
| Subject: | note 90972 added to function.stripos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-155714@lists.php.net to get a copy of this message | ||
Re the warning, it is perhaps worth clarifying that the === operator cannot be used to test for a
true condition,because an integer return is not literally a Boolean true.
'!==false' is the only valid form of a test for 'found anywhere.'
This issue also affects straight logical tests such as if(stripos($str1,$str2)) -which return
anomalous results when $str1==$str2.
Indexing strings from one removes all of these anomalies, but no doubt the academics will rail
against such a suggestion.
----
Server IP: 64.71.164.2
Probable Submitter: 212.159.68.116
----
Manual Page -- http://www.php.net/manual/en/function.stripos.php
Edit -- https://master.php.net/note/edit/90972
Del: integrated -- https://master.php.net/note/delete/90972/integrated
Del: useless -- https://master.php.net/note/delete/90972/useless
Del: bad code -- https://master.php.net/note/delete/90972/bad+code
Del: spam -- https://master.php.net/note/delete/90972/spam
Del: non-english -- https://master.php.net/note/delete/90972/non-english
Del: in docs -- https://master.php.net/note/delete/90972/in+docs
Del: other reasons-- https://master.php.net/note/delete/90972
Reject -- https://master.php.net/note/reject/90972
Search -- https://master.php.net/manage/user-notes.php