3v4l.org

run code in 300+ PHP versions simultaneously
<?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 { } }

preferences:
45.99 ms | 402 KiB | 5 Q