$n="MyRR";
class N extends $n{}
syntax error, unexpected '{', expecting identifier (T_STRING) or namespace (T_NAMESPACE) or \\ (T_NS_SEPARATOR) (0)
<?php
class A{}
$class_name = 'A';
$code = <<<CODE
class B extends $class_name{}
CODE;
eval($code);
if(new B() instanceof A){
echo 'Ok';
}