I have a doubt that maybe someone can answer here. My Code works great, but I am quiet sure, I do it somehow wrong. There has to be an easier and cleaner way to achieve it.
Assume this Class:
class myClass {
public static function myFunctionOne ($arg_one, $arg_two, $arg_tree) {
echo $arg_one;
myClass::$arg_two($arg_tree);
}
public static function myFunctionTwo ($arg_four) {
echo $arg_four;
}
}
Then you call above Class somewhere (my case a HTML Menu built in a PHP File) as the below:
myClass::myFunctionOne('echo a string', 'myFunctionTwo', 'echo forth value');
This works great, and it outputs:
echo a string echo forth value
But is it legit?
It looks sketchy to me. Can I use Functions like that, to call a Function with Argumetns in a Function with arguments?
myClass::$arg_twomethod is defined onmyClass