I have a switch statement     switch ( $id ) {        case 'abc':    return 'Animal';        case 'xyz':    return 'Human';                    //many more                    }I am returning class names,and use them to call some of their static functions using call_user_func().Instead I can also create a object of that class, return that and then call the static function from that object as $object::method($param)    switch ( $id ) {        case 'abc':    return new Animal;        case 'xyz':    return new Human;                    //many more                    }Which way is efficient?To make this question broader : I have classes that have mostly all static methods right now, putting them into classes is kind of a grouping idea here (for example the DB table structure of Animal is given by class Animal and so for Human class). I need to access many functions from these classes so the switch needs to give me access to the class
Passing class names or objects?
php;object oriented;efficiency
Obviously, needlessly calling a constructor for the sole reason of calling a static method is less efficient. Apparently there is some kind of meta-class encapsulating the static behavior of Animal/Human or perhaps the static method has the wrong location. The situation reeks of a modelling/design error, but there isn't enough context to determine which.