PHP Function Get_Class_Methods
The php function get_class_methods returns an array of methods that have been defined for the class identified by name_of_class. The function is available in PHP5 and does not require a class to be explicitly loaded using include / require or classname = "" in the constructor. This makes it suitable for projects that need to find classes in a larger list of class instances, such as automated class documentation or generic object debuggers.
However this function also returns all inherited methods, so it is not appropriate for finding overridden static methods in a derived class. The solution is to use the __CLASS__ definition of PHP to pass the class name of the derived class to its base class. This can be done by making the derived class's constructor protected abstract and returning a call to this method in its local object scope.
In this example we have a Car class that has a static function called get_int(). The function is overridden in a Bar class that extends the Car class. We need to be able to determine what class a given call to the get_int() method is made from, in order to find out which overridden static method it is calling.
In this example, we have the constructor of the Car class set to return a call to the get_int() method in the Bar class, as shown below. We also use the php function strtolower() to convert all string values returned by get_class_methods into lower case. This ensures that the string returned by get_class_methods is valid, and that it can be used in an array. This array is then sorted to identify the call that we need to take.