- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.30
- Fatal error: No code may exist outside of namespace {} in /in/6iAGF on line 6
Process exited with code 255.
<?php
namespace Foo\Bar {
class MyException extends \Exception {}
}
$exception = new Foo\Bar\MyException;
$exceptionName = get_class($exception);
if (($pos = strrpos($exceptionName, '\\')) !== false) {
$exceptionName = substr($exceptionName, $pos);
}
var_dump($exceptionName);