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 = static::HTTP_NOT_FOUND . ' - Page not found' // One off error messages can use this method... public static function notFound() { switch($num) { case 404: return new static("Error code $num: " . static::ERROR_404_RESPONSE); break; } } } HttpException::notFound();
Output for 7.0.0 - 7.0.2
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting ',' or ';' in /in/s0q87 on line 9
Process exited with code 255.
Output for 5.3.21 - 5.6.17
Fatal error: "static::" is not allowed in compile-time constants in /in/s0q87 on line 6
Process exited with code 255.