3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Ex extends Exception { private $code; public function __construct($message, $code) { $this->code = $code; parent::__construct($message); } } try { throw new Exception('aaa', 'aaa'); } catch (Exception $e) { var_dump($e->getCode()); }
Output for 5.3.0 - 5.4.30
Fatal error: Access level to Ex::$code must be protected (as in class Exception) or weaker in /in/aiK9B on line 9
Process exited with code 255.