- Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.27
- Parse error: syntax error, unexpected ';', expecting '{' in /in/FuUH5 on line 4
Process exited with code 255.
<?php
namespace Foo\Bar {
class Baz;
}
namespace {
function byReflection($obj) {
$r = new ReflectionObject($obj);
return $r->getName();
}
function byString($obj) {
$class = get_class($obj);
return substr($class, strrpos($class, '/'));
}
$a = new StdClass;
$b = new Foo\Bar\Baz;
var_dump(byReflection($a), byString($a), byReflection($b), byString($b));
}