Methods v16

Methods are SPL procedures or functions defined in an object type. Methods are categorized into three general types:

  • Member methods Procedures or functions that operate in the context of an object instance. Member methods have access to and can change the attributes of the object instance on which they're operating.
  • Static methods Procedures or functions that operate independently of any particular object instance. Static methods don't have access to and can't change the attributes of an object instance.
  • Constructor methods Functions used to create an instance of an object type. A default constructor method is always provided when an object type is defined.