Home >> PHP >> What is object in PHP

What is object in PHP

Object:-Real time entities or physical existance in the memory is called object.

*Air, water & fire is not object.

Every object has two things-

1)-Property

2)-Behaviour

Property will not change but behavior change according to the need.

Create object by new keyword.

Example:-

class abc {

      public function sum(){

      }

}

$obj=new abc();

Post Your Comment

Next Questions
What is static variable
What is static method
What is constructor
Why use constructor
Predefined constructor
Parameterized constructor
What is destructor
What is Polymorphism
What is Polymorphism types
What is overloading
What is overriding
What is abstraction
What is abstract class
Implementation of abstract method
What is interface
What is difference between abstract class and interface
What is inheritance
Inheritance types
What is single inheritance
What is multiple inheritance
What is multilevel inheritance
How to use static method and property in inheritance
How to use self and parent with static
How to use self and parent without static
What is visibility

Copyright ©2022 coderraj.com. All Rights Reserved.