3
In a certain project I am in error when trying to create a variable as a function, for example:
namespace Classes;
class Teste
{
public static function abc() { return 'teste'; }
}
Calling the function usually works:
\Classes\Teste::abc();
But when I try:
$class = "\Classes\Teste::abc";
$class();
It returns an error:
Fatal error: Call to undefined function \Classes\Teste::abc()
The goal is just to invoke the method? or has something else?
– rray
I need to execute the function being that the class name is generated dynamically.
– tadeubarbosa