PHP OOP

An Exception is an abnormal (Unwanted) conditions which arise at the time of execution of Program.I also say exception is “Run-Time Error”. Concept of exception was introduced in  PHP 5 with OOP.Exception interrupt the program flow if something goes wrong in it.(exception e). e is an object of class.An exception is an object that is thrown by program.

This entry is part 6 of 6 in the series PHP Reserved Functions

Same as other magic functions, these functions also adds some magic functionality to your code. __invoke calld once object is treated like a function. __clone is called once the object cloning is done. __toString will decide how the class should behave when treated as a string.

This entry is part 5 of 6 in the series PHP Reserved Functions

As we all know that PHP is the loosely coupled scripting languange. This means we can assign the values to the variables without declaring the variable.
Due to this loosely coupled architecture, PHP have provided two magic functions to handle the store and retrieve request of the undefined variable. Those two methods are __get and __set.

This entry is part 4 of 6 in the series PHP Reserved Functions

__sleep and __wakeup function will call once you make the serialize() and unserialize() operation to your class object.

This entry is part 3 of 6 in the series PHP Reserved Functions

When you define these functions in your class then it will call once you made call to any method of the class which is not declared/defined yet.

Meet the Expert Developer  php5.in For Sale