-
Video : Classes, properties, objects in PHP
-
Video : Classes, properties, objects part 2
-
Video : Constructor in PHP
-
Video : Inheritance in object-oriented programming in PHP
-
Video : Method overriding in php
-
Video : Access Modifiers in php
-
Video : Access Modifiers part 2 in php
-
Video : Scope Resolution operator in PHP
-
Video : Interfaces in PHP | OOP in PHP
-
Video : Final Keyword in php
-
Video : Abstract class and method in PHP
Inheritance in object-oriented programming in PHP
Please Login and enroll in this course to view the lesson.
Another OOP concept is inheritance, why you need inheritance..? how can we reuse our code..? You gonna learn inheritance in PHP in this video.
class Car{
public $carName;
public $carPrice;
public $carColor;
public static $myStaticProperty = 'shakzee.com';
private $myPrivate = 'shakzee';*/
private function myFunction(){
echo 'Private function';
}
public function display(){
echo $this->carName.'<br>';
echo $this->carColor.'<br>';
echo $this->carPrice.'<br>';
//echo $this->myProperty;
//echo $this->myPrivate;
$this->myFunction();
}
public function test($para){
echo $para . ' method ';
}
public static function myStatic(){
echo 'my static method';
}
}//class
class BMW extends Car {
}
Car::myStatic();
echo '<br>';
echo Car::$myStaticProperty;