note 124562 added to function.strpos
| From: | ds at kala-it dot de | Date: | Fri, 03 Jan 2020 09:35:55 +0000 |
| Subject: | note 124562 added to function.strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213726@lists.php.net to get a copy of this message | ||
Note this code example below in PHP 7.3
<?php
$str = "17,25";
if(FALSE !== strpos($str, 25)){
echo "25 is inside of str";
} else {
echo "25 is NOT inside of str";
}
?>
Will output "25 is NOT inside of str" and will throw out a deprication message, that non
string needles will be interpreted as strings in the future.
This just gave me some headache since the value I am checking against comes from the database as an
integer.
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.168 (proxied: 92.79.72.226)
----
Manual Page -- http://php.net/manual/en/function.strpos.php
Edit -- https://master.php.net/note/edit/124562
Del: integrated -- https://master.php.net/note/delete/124562/integrated
Del: useless -- https://master.php.net/note/delete/124562/useless
Del: bad code -- https://master.php.net/note/delete/124562/bad+code
Del: spam -- https://master.php.net/note/delete/124562/spam
Del: non-english -- https://master.php.net/note/delete/124562/non-english
Del: in docs -- https://master.php.net/note/delete/124562/in+docs
Del: other reasons-- https://master.php.net/note/delete/124562
Reject -- https://master.php.net/note/reject/124562
Search -- https://master.php.net/manage/user-notes.php