$className = 'MyTestClass'; if (!class_exists($className)) { return null; } $reflectionClass = new ReflectionClass($className); $classInstance = $reflectionClass->newInstance(); return $classInstancecode
$className = 'MyTestClass'; if (!class_exists($className)) { return null; } $reflectionClass = new ReflectionClass($className); $classInstance = $reflectionClass->newInstance(); return $classInstance