PHP Notes

 

PHP Namespaces

Namespaces are qualifiers that solve two different problems:

  1. They allow for better organization by grouping classes that work together to perform a task
  2. They allow the same name to be used for more than one class
Reference From 
https://www.w3schools.com/php/php_namespaces.asp

How to resolve the diamond issue in PHP ?

The “diamond problem” (sometimes referred to as the “deadly diamond of death”) is an ambiguity that arises when two classes B and C inherit from A, and class D inherits from both B and C
Overloading and Overriding

What is Overloading and Overriding? When two or more methods in the same class have the same name but different parameters, it's called Overloading. 

When the method signature (name and parameters) are the same in the superclass and the child class, it's called Overriding.





Comments

Popular posts from this blog

Laravel Notes By Ahmed Awan