CLASS & OBJECT in PHP

DevOps

MOTOSHARE 🚗🏍️
Turning Idle Vehicles into Shared Rides & Earnings

From Idle to Income. From Parked to Purpose.
Earn by Sharing, Ride by Renting.
Where Owners Earn, Riders Move.
Owners Earn. Riders Move. Motoshare Connects.

With Motoshare, every parked vehicle finds a purpose. Owners earn. Renters ride.
🚀 Everyone wins.

Start Your Journey with Motoshare

The basic concepts of Object-oriented programming concepts are:

  • Class
  • Object
  • Inheritance
  • Constructor
  • Destructor
  • Polymorphism

CLASS

A class is a template which represents a real-world entity, and it defines properties and methods of the entity. It is only structure of operations , it comes in action when object is being created

You could think of class properties as variables that are used to hold information about the object.

Complete Tutorials of PHP OOP Destructor with Example code -  DevOpsSchool.com
Example of class

Object

Objects are an instance of a class. A variable holds the data of a class. You must define a class once and subsequently create as many objects as needed in it.Objects are defined from classes in Object-Oriented Programming like PHP. When a class is defined, we can create many objects out of the class. 

example :-

$parrot = new Fun();
$pigeon = new Fun();
$woodpecker = new Fun();