Object Oriented Programming using PHP

Veröffentlicht am: 10 Februar 2023
auf dem Kanal: Shantanu Mukherjee
95
4

Object Oriented Programming using PHP. OOPS in PHP

1. Class
2. Objects
3. Constructor
4. Encapsulation
5. Inheritance
6. Interface
7. Abstract Class
8. Polymorphism

1. Class is a collection of objects.

2. Object is an instance of class.

3. __construct() it will automatically called on creation of an object. __destruct() function which is automatically called at the end of the script.

4. Encapsulation is about access of data and method in a class. Properties and methods can have access modifiers which control where they can be accessed.
public - the property or method can be accessed from everywhere. This is default
protected - the property or method can be accessed within the class and by classes derived from that class
private - the property or method can ONLY be accessed within the class.

5. Inheritance - Inheriting the properties or functionalities from one class to another class using the extends keyword.

6. Interface - Through Interface you can achieve multiple inheritance property. Interfaces also worked like abstract classes.

7. Abstract Classes: Abstract classes are those classes where functions are declared but not used and need its child class to fill out the tasks.

8. Polymorphism - Polymorphism means more than one form
Method overloading is the example of compile time polymorphism. Method overriding is the example of run time polymorphism.
Overloading - more than one function can have same method signature but different number of arguments.
Overriding, more than one functions will have same method signature and number of arguments.


Auf dieser Seite können Sie das Online-Video Object Oriented Programming using PHP mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Shantanu Mukherjee 10 Februar 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 95 Mal angesehen und es wurde von 4 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!