What is Object and Class in PHP

1- Objects is collection of member variables(member data and member function)
2- Object is an instance of a class
3- Object use some space in memory
4- Object is real word entity
5- Banana,apple,orange are example of object
6- You and me are example of of object
7- Chair,Table are example of objects

object is created by new keyword.


1- Class is group of objects with same attributes and common behaviors
2- Class is set of objects
3- Class don't use space in memory
4- Class is user defined datatype
5- Class is logical entity
6- Fruit is example of class
7- Person is example of class
8- Furniture is example of class

Class is defined by using the class keyword,In a class,. class names conventionally are written in PascalCase (e.g. TestClass). variables are called properties and functions are called methods
class test
   function myFunc()
     echo "Welcome Class...";


$obj = new test();
Welcome Class...

//test is class name
//$obj is object name