Object Oriented Programming is a paradigm which is nowadays the most popular way to develop any application and most of the modern day language is based on this paradigm.
OOP or Object Oriented Programming PHP has so many features like:
Class
Object
Polymorphism
Dynamic Binding...etc.
In this series of tutorial you will come to know about all the features of these features using PHP syntax.
PHP Class Object
In object oriented programming a class can be an abstract data type, blue print or template. You could consider the name of a class as noun like name of a person, place or thing. For example Fruit is a class, where apple, orange are the object of this class.
PHP Constructor and Destructor
In this current tutorial we will study about constructor and destructor of OOP.Like other OOP based languages PHP also supports constructor method for classes. As any other language's constructor method, in PHP constructor method is called for every object creation.
PHP Class Constant
In this tutorial we will study how to declare a class constant in PHP. Sometimes we need to have constant values in our program which remains same through and through. We do not need to put a '$' sign before the constant to use or to declare it.
PHP Create Instance
In the current tutorial we will study how to instantiate an object in PHP. Example will help you to learn it precisely. You will also come to know about the use of new, -> operator.
PHP Inheritance Class
Inheritance is a property of Object Oriented Programming, PHP also supports this principle in its programming as object model. With the help of this property classes and objects get more flexibility, scalability in programming
PHP Mutator Accessor
In object-oriented programming, the mutator method (also called "setter") is used to initialize the member variables of a class. On the other hand accessor methods are used to get the values of the private data member.
PHP Autoload
It is very common in PHP programming that we need to write long listing of files which has to be include in a single file. It is indeed a hectic job for each PHP programmer.
PHP Static Variable and Methods
In this tutorial we will study when we should use static methods and variables. Static keyword is used to make only one copy of the variable for the class. If we declare a method as static then we can access the method using class, without instantiating any object.
PHP Abstract Class
In this tutorial we will study about abstract class in PHP, how to declare, use an abstract class etc. Examples will help you to understand the concepts of abstract class more precisely.
PHP Access Specifiers
In the current tutorial we will get to know about different types of access specifiers or visibility in PHP. You will also come to know that what could be difference in public, private and protected access specifiers. What could be the difference if we use these keywords before a method and before variables. Examples will exemplify each of the above concepts
PHP Interface Class
In this tutorial you will study about interface of PHP, how to declare and implement an interface, what points should be kept in mind when we declare an interface etc. Interface is also a class but it has few constraints unlike any other ordinary concrete class and it supports the multiple inheritance.
PHP Polymorphism Function
PHP Polymorphism Function is one of the feature of OOP. Generally we get polymorphism in two ways: Compile time, Run time. In this tutorial we will study about which polymorphism is supported by PHP and which one is not.
PHP Object Iteration
This PHP tutorial will introduce a new feature which has been introduced in PHP 5 called Object iteration. In PHP 5 a new way for objects is introduced to iterate through a list of items. In this technique we generally use foreach statement.
PHP Design Patterns
In this tutorial we will study what is a design pattern and in the subsequent pages we will study about various design patterns supported by PHP. A design pattern is like a template which guides us to solve a problem. Design patterns are not finished design that can be transformed directly into code. In Object Oriented based design patterns we can get the interactions and relationships between classes or objects.
PHP Factory Method
It is very common problem that sometimes we need to change a little in our coding and subsequently we have to change so many places like in other class, function etc. It is called tight coupling. In this case factory pattern helps us a lot. In the current tutorial we will study about factory method and how to implement this in PHP.
PHP Singleton Method
In the current php tutorial we will study about singleton pattern of PHP, which is another type of designing pattern. Examples will help you understand in better way.
PHP Observer Method
In this pattern one object make itself observable and other objects observed it. The object which is observed is called subject. When the observable object changes it passes some message to the observer and the observer uses those message according to their need..
PHP OOP Namespace
The term namespace is very much common in OOP based language, basically it is a collection of classes, objects and functions. Namespace is one of the major change in PHP 5.3.0. Naming collision of classes, functions and variables can be avoided.
PHP Object Reference
In this current tutorial we will study about what is object and what is reference? how to create object in PHP, how to give reference to another object etc. In PHP a reference is an alias and an object variable does not contain the object rather it contains the identifier and it allows to access the actual object.
PHP Comparison Objects
In this current tutorial we will study about the various ways of comparing two objects. There are several ways are provided in PHP to compare two objects of class (same or different)like ==,=== etc operators are present to compare two objects.
PHP Type Hinting
Type hinting is a special type of function which is introduced in PHP version 5. This function is used to explicitly typecast a value into objects of a class or to an array.If the datatype (class or array) of actual argument does not match with the formal argument then an error message will be automatically generated. This is applicable to only object of any class type or array type
PHP Final Keyword
In this current tutorial we will study about final keyword, final keyword helps us to put some constraint on classes and it's methods. Using final keyword a class can not be inherited and a method can not be overridden.
PHP Object Reference
In this current tutorial we will study about what is object and what is reference? how to create object in PHP, how to give reference to another object etc. In PHP a reference is an alias and an object variable does not contain the object rather it contains the identifier and it allows to access the actual object.
PHP Comparison Objects
In this current tutorial we will study about the various ways of comparing two objects. There are several ways are provided in PHP to compare two objects of class (same or different)like ==,=== etc operators are present to compare two objects.
PHP Type Hinting
Type hinting is a special type of function which is introduced in PHP version 5. This function is used to explicitly typecast a value into objects of a class or to an array.If the datatype (class or array) of actual argument does not match with the formal argument then an error message will be automatically generated. This is applicable to only object of any class type or array type
PHP Late Static Binding
In this current PHP tutorial Section, we will study about late static binding in PHP, what is late static binding, how to use late static binding among classes, what are the uses of it in PHP etc.
PHP Magic Methods
In this PHP tutorial you will come to know about various methods which are called as magic methods. This is the first page on this topic and the subsequent pages will help you to understand each and every magic method precisely.
PHP Sleep Wakeup Method
This is one of the magic method provided by PHP. The __sleep function in PHP is useful when we have very large objects in our program and we do not want to save the object completely and __wakeup() of PHP is used to reestablish the database connections that may have been lost during any phenomenon.
PHP toString Function
In PHP 5.3.0 a method has been introduced called toString(), basic functionality of the method is to print an object, how? current tutorial is trying to focus on this topic.
PHP invoke Method
Have you ever wondered that how to call an object as function? Thanks to __invoke method, introduced in PHP 5.3.0, with the help of this function we can do it. The present tutorial is all about this PHP invoke function.
PHP set static Method
In this current tutorial we will study about a new method called __set_static(), which is introduced in PHP 5. With the help of this method we can assign values to a new object dynamically. Examples will help to understand the concept
PHP Clone Object
In this PHP tutorial, we will study about cloning of object, how to make a clone object, what are the process of cloning in PHP 5 and how is it different from PHP 4
PHP References Explained
This tutorial covers three basic operations performed by references, assigning values by references, passing by references, returning by references etc. In PHP references means to access the same variable by two or more different names.