3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class HttpException extends \Exception { const HTTP_NOT_FOUND = 404; const ERROR_404_RESPONSE = 'Page not found'; // One off error messages can use this method... public static function notFound() { throw new static("Error code 404: " . static::ERROR_404_RESPONSE); } } HttpException::notFound();
based on SSdZp
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught HttpException: Error code 404: Page not found in /in/ttUTa:11 Stack trace: #0 /in/ttUTa(15): HttpException::notFound() #1 {main} thrown in /in/ttUTa on line 11
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Fatal error: Uncaught exception 'HttpException' with message 'Error code 404: Page not found' in /in/ttUTa:11 Stack trace: #0 /in/ttUTa(15): HttpException::notFound() #1 {main} thrown in /in/ttUTa on line 11
Process exited with code 255.