3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Foo\Bar; function t() { throw NAN; } define('Foo\\Bar\\NAN', 'Exception'); t();
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Can only throw objects in /in/Ya52d:8 Stack trace: #0 /in/Ya52d(11): Foo\Bar\t() #1 {main} thrown in /in/Ya52d on line 8
Process exited with code 255.
Output for hhvm-3.12.0 - 3.13.2
Fatal error: Uncaught Error: Exceptions must implement the Throwable interface. in /in/Ya52d:8 Stack trace: #0 /in/Ya52d(11): Foo\Bar\t() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: Exceptions must be valid objects derived from the Exception base class in /in/Ya52d on line 8
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Fatal error: Can only throw objects in /in/Ya52d on line 8
Process exited with code 255.