<?php
class Foo {
public function __toString() {
return "foo";
}
}
function stripos2(string $haystack, string $needle) {
return stripos($haystack, $needle);
}
var_dump(stripos2("foobar", new Foo()));
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.