- substr: documentation ( source)
- var_dump: documentation ( source)
<?php
$instance = new class {};
$c = get_class($instance);
$buf = substr($c, -14);
$class_name = "class@anonymous".chr(0).__FILE__.$buf;
eval("$x = new $class_name extends stdClass{};");
var_dump($x);