Skip to main content

Posts

Showing posts from 2014

PHP Object Oriented Programming

PHP Object Oriented Programming Introduction Object-oriented programming is an approach of programming where objects and classes are used. Now-a-days Java and C++ are mostly used for object-oriented programming. There was limited scope of object oriented programming in PHP 4, but in PHP 5, the object model was rewritten for better performance and more features. Now PHP 5 has a full object model. Table of contents Object, classes PHP : Creating classes and Instantiation Setting Properties Setting Methods PHP : Scope Resolution Operator (::) PHP : Class Constants Understanding public, private, protected properties Understanding public, private, protected methods PHP : Constructor methods PHP : Destructors methods PHP : Using multiple instances of the same class PHP : spl_autoload_register() PHP : Inheritance PHP : Interfaces PHP : Object Cloning PHP : Magic methods What is an object ? The fundamental idea behind an object-oriented language is...