About the concepts of OOP in PHP5 from basics to very advanced level. We have learned about the class basic and public class properties in our previous tutorials. Today i am going to write about the basics of class methods.
“Class properties allow your objects to store data and class methods allow your objects to perform tasks.”
What are Class Methods
Methods are special functions declared within a class. As you might expect, a method declaration resembles a function declaration. The function keyword precedes a method name, followed by an optional list of argument variables in parentheses. The method body is enclosed by braces.