Function for Checking Method Existence in OOP in PHP
Make a class Test
with a method method1
and without a method method2
. Check what
the function method_exists
will output for
the method method1
and for the method
method2
.
Let GET parameters be passed in the address bar as the class name and its method. Check if such a class exists. If it exists - check for the existence of the passed method. If the method also exists - create an object of this class, call the specified method and output the result of its work on the screen.