You will still have to run cron to schedule the php call, since php depends on a request to be interpreted.
You can write a class in PHP and use the methods class_exists to check whether the class x exists, if it exists you create an instance of it and use the method, method_exists to check whether the method y exists. If it exists, you execute the method.
You can use php as a script to call it in terminal via cli, just inform that the text interpreter to be used is php, adding an instruction similar to the instruction after the beginning of the file, (I speak similar, because it should have the path of your php interpreter, if you do not know where to find can type in the console whereis php, which will be displayed).
#!/usr/local/bin/php
I’m assuming you’re using linux.