3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function __toString() { return "foo"; } } function stripos2(string $haystack, string $needle) { return stripos($haystack, $needle); } var_dump(stripos2("foobar", new Foo()));
Output for 7.0.33, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.3
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.

preferences:
135.14 ms | 407 KiB | 5 Q