3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public function tryInclude() { try { require $this->getFileName('include'); } catch (Exception $e) { echo "Catched"; } } private function getFileName($action) { $file = '/unknown/path/to/file'; if (false === file_exists($file)) { throw new Exception(sprintf('The file for this %s was not found.', $action); } else { return $file; } } } $instance = new Foo; $instance->tryInclude();
Output for 5.3.0 - 5.4.17
Parse error: syntax error, unexpected ';' in /in/QHWKE on line 19
Process exited with code 255.