0op’s In php:
- PHP 5.0 supporting number of object oriented programming concept like inheritance,interface, etc.
- oops concept we can sue to increase security,re-usability and application performance.
- According to oops every statement we should place within the class.
- class is the collection of members ,class contains members of properties and methods.
- variables deceleration within the class we can call as property, function deceleration within the class we can call as method.
- object is the instance of class(memory location of class) we can access class member with the help of object
- using this key word we can allocate new memory location to load the class constants.
- It is type of method contains class name as method name.
- By default every class contains a constructors use to load class member into memory location.
- we can also create external constructor to execute some statement at time of creating object to the class.
- In php we can create constructor in two ways.
1.Using class name 2.using __construct key word.
- It is type of method use at time of destroying.
- If you want to execute some statement just before destruction of object we can use destructor.
- By using __destroy key word we can create destructor in php program.
- $this is a global variable use to access properties of class from method of that class.