Tag: php

PHP Inheritance

Way1 to inherit one class from another using the keyword extends <?php class Course{                 protected...
READ MORE   >>

PHP Abstraction

Code below defined an TV class. We cannot do much with it except turning it on and off. The class TV is an abstraction of a real TV in a very simple use case. <?php class TV {       private $isOn =...
READ MORE   >>

PHP Encapsulation

Encapsulation is used to bind the data using get and set method or hide the values to prevent from unauthorized parties' to directly access them. For encapsulation, we generally use the concept of visibility (public, private, protected). Public...
READ MORE   >>

PHP Constructor & Destructor

Create a Course class for student that display their course code and subject enrolled from an institute. Explanation Way 1: <?php class Course{             public function...
READ MORE   >>

Recent Comments

    • Copyright © 2020 (Er. Shairy Kalra). All Rights Reserved