3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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)); }
Output for 5.3.0 - 5.4.27
Parse error: syntax error, unexpected ';', expecting '{' in /in/FuUH5 on line 4
Process exited with code 255.