- Output for 5.3.0 - 5.3.28, 5.4.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.
<?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());
}