I’m just getting into using classes in php and am coming from a C++ background. Literally every example I’ve seen shows methods being defined inside of the class definition, and I’m wondering if I can define my class methods outside of the class definition in order to improve readability?
Share
Sort of. PHP 5.4 itroduced traits which is about as close as you’re gonna get.