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.
Advance PHP
PHP have many more functions for the file management, touch() is one of them. touch() function will set the access and modification time of the file.
We can handle the PHP Fatal Errors using the combination of the register_shutdown_function() and error_get_last() functions.
register_shutdown_function() will register your script ending handler and error_get_last() will provide the detail of the last error occured.
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.
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.
