PHP and OOP



1 - PHP - What is OOP?

PHP - What is OOP?

PHP - What are Classes and Objects?

class


Fruit
objects


Apple
Banana
Mango
class


Car
objects


Volvo
Mazda
Toyota

2 - PHP OOP - Classes and Objects

OOP Case

Define a Case

oop-0001 - Code to create a class oop-0002 - Code to create a class with properties

Define Objects

oop-0003 - two instances of the class Fruit oop-0004 - two more methods: the class Fruit

PHP - The $this Keyword

oop-0005 - example oop-0006 - two ways to change the $name property oop-0007 - directly, outside the class

PHP - instanceof

oop-0008 - does object belong to a specific class

3 - PHP OOP - Constructor

PHP - The __construct Function

oop-0009 - using a constructor saves us from calling the set_name() method oop-0010 - Another example

4 - PHP OOP - Destructor

PHP - The __destruct Function

oop-0011 - a __destruct() function that is automatically called at the end of the script oop-0012 - Another example

5 - PHP OOP - Access Modifiers

PHP - Access Modifiers

oop-0013 - access modifiers which control where they can be accessed oop-0014 - added access modifiers to two functions

6 - PHP OOP - Inheritance

PHP - What is Inheritance?


7 - PHP OOP - Constants

PHP - Class Constants


8 - PHP OOP - Abstract Classes

PHP - What are Abstract Classes and Methods?


9 - PHP OOP - Interfaces

PHP - What are Interfaces?


10 - PHP OOP - Traits

PHP - What are Traits?


11 - PHP OOP - Static Methods

PHP - What are Static Methods?


12 - PHP OOP - Static Properties

PHP - What are Static Properties?


13 - PHP OOP - Namespaces

PHP - What is Namespaces?


14 - PHP OOP - Iterables

PHP - What is an Iterable?



Reserve