Posted on November 5th, 2007 by admin
Before I begin to explain the use of a __clone() method, lets try and understand what does object cloning mean.
To clone an object means to create a duplicate of an object. With regular variables $a = $b means that a new variable $a gets created that contains the value of $b. This means that 2 […]
Filed under: PHP, PHP Tutorials, PHP5 Magic Methods, PHP5 OOPS Tutorials | 4 Comments »
Posted on November 3rd, 2007 by admin
The magic method __sleep() and __wakeup() is called when an object is serialized. The magic method __sleep() and __wakeup() provides a method to clean up and restore objects before being serialized.
Working with the magic method __sleep()
__sleep() magic method is called when the object of a class is about to be serialized. This magic method __sleep() […]
Filed under: PHP, PHP Tutorials, PHP5 Magic Methods, PHP5 OOPS Tutorials | 2 Comments »
Posted on November 3rd, 2007 by admin
This tutorial will teach you how and when to use the magic method __autoload().
The magic method __autoload() function is a convenience that allows you to use classes without having to explicitly write code to include them.
The magic method __autoload() is not included in your class definition as this is to be called once in a […]
Filed under: PHP, PHP Tutorials, PHP5 Magic Methods, PHP5 OOPS Tutorials | 3 Comments »
Posted on November 3rd, 2007 by admin
This tutorial will teach you how and when to use the magic method __call().
The magic method __call() is to undeclared methods what __get() and __set() are to undeclared data member.
These methods are automatically called internally when the program tires to execute a method that has not been defined within the class at the time of […]
Filed under: PHP, PHP Tutorials, PHP5 Magic Methods, PHP5 OOPS Tutorials | 2 Comments »
Posted on November 3rd, 2007 by admin
In my previous PHP5 OOPS tutorial on PHP5 Tutorial - Magic Methods - __get() and __set(), we learnt how and when to use these magic methods.
This PHP5 OOPS tutorial will teach you how and when to use the magic methods __isset() and __unset().
[…]
Filed under: PHP, PHP Tutorials, PHP5 Magic Methods, PHP5 OOPS Tutorials | 3 Comments »