3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php if (!interface_exists('Throwable', false)) { interface Throwable { public function getMessage(); public function getCode(); public function getFile(); public function getLine(); public function getTrace(); public function getTraceAsString(); public function getPrevious(); public function __toString(); } } if (!class_exists('Error', false)) { // We can't really avoid making this extend Exception in PHP 5. class Error extends Exception implements Throwable { } } if (!class_exists('TypeError', false)) { class TypeError extends Error { } }
Output for 5.3.0 - 5.6.38, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.3.1
Output for 5.0.5 - 5.2.17
Fatal error: Class Error contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Throwable::getPrevious) in /in/ei523 on line 22
Process exited with code 255.
Output for 5.0.2 - 5.0.4
Fatal error: Class Error contains 1 abstract methods and must therefore be declared abstract (Throwable::getPrevious) in /in/ei523 on line 22
Process exited with code 255.
Output for 5.0.0 - 5.0.1
Fatal error: Call to undefined function interface_exists() in /in/ei523 on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING in /in/ei523 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING in /in/ei523 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/ei523 on line 4
Process exited with code 255.