Tagged: php oops concepts

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...

Typing Hint 0

Type hinting

Type hinting forces our functions and methods to get only arguments that belong to a specific class,  a specific interface, or to arrays. This practice can be most advantageous because it results in better...

Chaining Methods and Properties 0

Chaining methods and properties

In the previous tutorial, we learned to use the $this keyword to approach properties and methods within the scope of the class. In this tutorial we will learn that, when a class’s methods return the $this...

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...

Basics of PHP oops Concepts 0

Basics Of OOPs in PHP

Object oriented programming is a technique to design your application. In object oriented programming, everything will be around the objects and class. By using OOP in php you can create modular web application. By...