How to call a function from inside class to outside class September 12, 2022 by Tarik Billa Remove the () after myclass. Then in your myfunction2: $obj = new myclass(); $obj->myfunction();