- Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
- Parse error: syntax error, unexpected ';' in /in/fkhFY on line 19
Process exited with code 255.
<?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();