Custom Search

Exploring Magic Methods in PHP 5

With PHP 5 Object Oriented Programming seems to becoming a reality in PHP but we all know that in PHP a variable can take any form depending on the data passed to it. Also PHP automatically creates variable and assigns values to it even is the variables are not defined. But in Object Oriented Programming […]

PHP 5 Tutorial - __clone Magic Method

In PHP 5 when you assign one object to another object creates a reference copy and does not create duplicate copy. This would create a big mess as all the object will share the same memory defined for the object. To counter this PHP 5 has introduced clone method which creates an duplicate copy of […]

PHP 5 Tutorial - __toString() Magic Method

This tutorial will guide you through the __toString() Magic Method. The __toString() Magic method in PHP5 get called while trying to print or echo the class objects. This method can be used print all the methods and attributes defined for the class at runtime for debugging. Also this method can be used to give error […]

PHP 5 Tutorial - __autoload Magic Method

This tutorial will guide you through the __autoload() Magic Method. The __autoload() magic method of PHP5 get automatically called whenever you try to load an object of class which resides in separate file and you have not included those files using include,require and include_once. It is recommended to use the filename as that of the […]

PHP 5 Tutorial - __unset() Magic Method

This tutorial will guide you through the __unset() Magic Method. The __unset() magic method of PHP5 is called whenever unset function of PHP is called to clear an undeclared data member. With the help of this method we can check for the undeclared variables in the code. We can also set appropriate error message while […]

PHP 5 Tutorial - __isset() Magic Method

This tutorial will guide you through the __isset() Magic Method. The __isset() magic method in PHP5 is called whenever isset function of PHP is called to check for undeclared data member. With the help of this method we can check for the undeclared variables in the code. We can also set appropriate error message […]

PHP 5 Tutorial - __wakeup() Magic Method

This tutorial will guide you through the __wakeup() Magic Method. The __wakeup() magic method of PHP5 gets called when unserialize operation on object is performed. This method allows us to restore the serialized data to its normal form.

Bookmark It

Hide Sites

PHP 5 Tutorial - __sleep() Magic Method

This tutorial will guide you through the __sleep() Magic Method. The __sleep() magic method in PHP5 gets called while serializing an object in PHP5. Serializing is required to pass complex data across the network or PHP pages. It is also used to store data(files, database, cookies etc). With this magic method call we can define […]

PHP 5 Tutorial - __call() Magic Method

This tutorial will guide you through the __call() Magic Method. The __call Magic method in PHP5 get called when accessing an undeclared or undefined methods of an class. With this magic method the programmer can keep track on the undeclared method which are not defined inside the class.

Bookmark It

Hide Sites

PHP 5 Tutorial - __get() Magic Method

This tutorial will guide you through the __get() Magic Method. The __get Magic method in PHP5 gets called when accessing the value of an undeclared or undefined attributes of an class. With this method the programmer can keep track on the variables which are not defined inside the class.

Bookmark It

Hide Sites