What are some best practices for debugging PHP scripts that use in_array for value comparison?

When debugging PHP scripts that use in_array for value comparison, it's important to ensure that the values being compared are of the same type. If one value is a string and the other is an integer, for example, the comparison may not work as expected. To avoid this issue, you can use the strict parameter of in_array, which performs a strict type check.

$value = 2;
$array = [1, 2, 3];

if (in_array($value, $array, true)) {
    echo "Value found in array";
} else {
    echo "Value not found in array";
}