3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public function __toString() { return "foo"; } } function stripos2(string $haystack, string $needle) { return stripos($haystack, $needle); } var_dump(stripos2("foobar", new Foo()));
based on Mm9gW
Output for hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.3.1
int(0)
Output for 5.6.0 - 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.