3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class IOException extends Exception { protected $file; public function __construct($file, $message) { parent::__construct($message); $this->file = $file; } public function getFile() { return $this->file; } } class File { protected $path; protected $handle; public function __construct($path) { $this->path = $path; } public function open($mode) { $this->handle = @fopen($this->path, $mode); if (!$this->handle) { throw new IOException($this->path, "could not open the file"); } } } $file = new File("/no/file"); try { $file->open("r"); } catch (IOException $io) { $io->printStackTrace(); } ?>
Output for 5.3.0 - 5.4.22
Fatal error: Cannot override final method Exception::getFile() in /in/4v0O8 on line 13
Process exited with code 255.