Is it possible to call functions from class like this:
$class = new class;
$function_name = \"do_the_thing\";
$req = $class->$function_name();
You can use ReflectionClass.
Example:
$functionName = 'myMethod';
$myClass = new MyClass();
$reflectionMyMethod = (new ReflectionClass($myClass))->getMethod($functionName);
$relectionMyMethod->invoke($myClass); // same as $myClass->myMethod();
Remember to catch ReflectionException If Method Not Exist.