I have two classes with the same static methods but each class has different implementation of the methods. In my code I know which static method I need to call, but the class type is determined dynamically. Something like this:
class someClass_A {
public static function bar(){
//some implementation;
}
public static function foo(){
//some implementation;
}
}
class someClass_B {
public static function bar(){
//different implementation;
}
public static function foo(){
//different implementation;
}
}
I am trying to use the in this manner:
$class = 'someClass_' . $indicator;
$bar = $class::bar();
But it's not working. Can I dynamically create a class name and then use it to call static function of that class?