I have this incorrect piece of code:
$anArray = self::getArray();
echo strcmp($anArray, "comparison");
On 7.4.33 0 is echo’d.
On 7.4.3 I receive a TypeError:
strcmp(): Argument #1 ($string1) must be of type string, array given
I have used gettype()
to output the type of $anArray
and sure enough, it’s an array.
So why is 7.4.33 handling this? I wondered if I have something incorrectly set in php.ini for the 7.4.33 example?
I also notice phpstan doesn’t pick this up on 7.4.33 (I haven’t tested it on 7.4.3).