Tagged: PHP oops tutorials

Static Methods and Properties 0

Static methods and properties

public, protected and private. This chapter is devoted to the fourth modifier, static, that allows access to classes’ properties and methods without the need to create objects out of the classes. How to define...

The This Keyword 0

The $this keyword

As an example, we wrote a Car class that groups all the code that handles cars. class Car { public $comp; public $numWheels = 4; public $hasSunRoof = true; public function hello() { return...