3v4l.org

run code in 300+ PHP versions simultaneously
<?php FunkyException extends Exception { protected $errors = []; public function __constructor ($message, $errors) { $this->message = $message; $this->errors = $errors; } public function getErrors() { return $this->errors; } } try { throw new Exception ('test', ['this','that']); } catch (FunkyException $e) { print_r ($e->getErrors()); }
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected 'extends' (T_EXTENDS) in /in/dpSuC on line 3
Process exited with code 255.

preferences:
172.6 ms | 1399 KiB | 23 Q