OOP in PHP

OOP = Object Oriented Programming 

             By Al-Amin Islam

<?php
trait TraitName {

  // some code...

}

           class MyClass {
                             use TraitName;

}
?>

Traits

ClassName::staticMethod();

Static Method

Text

ClassName::$staticProp;

Static Properties

The static keyword is used to declare properties and methods of a class as static. Static properties and methods can be used without creating an instance of the class. The static keyword is also used to declare variables in a function which keep their value after the function has ended.

Text

Text

Text

Why Object Oriented Programming

1. OOP is faster easier to execute

2. Its provide to clear code structure for program

3. 1.Its makes the code easier to maintain , modify and debug

4. OOP helps to keep the code DRY (Don’t repeat Yourself)

5. Its helps to shorter development

OOP Class Module

Class & Object
Class Properties,Method & Method Overriding
The instanceof keyword
Class constructor and Destructor
Constructor overriding
Constant
Access Modifers
Inheritance & Multilevel Inheritance
Abstraction (Interface , Abstract)
Polymorphism
Trait
NameSpace
Static Method & Static Properties

# PRESENTING CODE



PHP-What are Classes and Objects?

 

OOP in PHP

By Alamin Islam

OOP in PHP

  • 92