3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(object $f) { var_dump($f); } try { test('hello'); } catch (Exception $e) { echo "asdasd"; }
Output for 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an object, string given, called in /in/rsJEh on line 8 and defined in /in/rsJEh:3 Stack trace: #0 /in/rsJEh(8): test('hello') #1 {main} thrown in /in/rsJEh on line 3
Process exited with code 255.
Output for 7.0.0 - 7.1.10
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of object, string given, called in /in/rsJEh on line 8 and defined in /in/rsJEh:3 Stack trace: #0 /in/rsJEh(8): test('hello') #1 {main} thrown in /in/rsJEh on line 3
Process exited with code 255.
Output for 5.3.18 - 5.6.28
Catchable fatal error: Argument 1 passed to test() must be an instance of object, string given, called in /in/rsJEh on line 8 and defined in /in/rsJEh on line 3
Process exited with code 255.