3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function doSomething(string $value) { try { $value .= " test"; } catch(Throwable $e) { var_dump($e); } return $value; } echo doSomething("Hello");
based on ZnAfV
Output for 7.0.0 - 7.2.0
Hello test
Output for 5.3.21 - 5.6.28
Catchable fatal error: Argument 1 passed to doSomething() must be an instance of string, string given, called in /in/eKn3e on line 13 and defined in /in/eKn3e on line 3
Process exited with code 255.