Please enable JavaScript.
Coggle requires JavaScript to display documents.
PHP OOP - Coggle Diagram
PHP OOP
-
-
Abstract Classes
Abstract classes and methods are when the parent class has a named method, but need its child class(es) to fill out the tasks.
Created using abstract keyword.
-
Static Properties
Static methods can be called directly - without creating an instance of the class first. By using static keyword
Classes / Objects
Class is template for Objects. Parent class are used for classifying (find similarities in) real world objects & concepts.
Objects are instance of a class. Created with new keyword.
-
Traits
PHP only supports single inheritance: a child class can inherit only from one single parent.
So, what if a class needs to inherit multiple behaviors? OOP traits solve this problem.
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.
Constructor
Called when an object is created. By using __construct keyword.
Used for initialize object properties.
-
Static methods can be called directly - without creating an instance of the class first. By using static keyword
-
-