PHP 8.4.24 Released!

Voting

: two plus six?
(Example: nine)

The Note You're Voting On

ds at kala-it dot de
6 years ago
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.

<< Back to user notes page

To Top