<?php
class Foo {
public function __toString() {
return "foo";
}
}
function stripos2(string $haystack, string $needle) {
return stripos($haystack, $needle);
}
var_dump(stripos2("foobar", new Foo()));
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
int(0)
Output for 5.6.38
Catchable fatal error: Argument 1 passed to stripos2() must be an instance of string, string given, called in /in/vthrq on line 13 and defined in /in/vthrq on line 9
Process exited with code 255.