PHP 5 Tutorial – Handling Exceptions in PHP5
In this tutorial we will cover the following:
- What is an exception?
- The use of a try…catch block
- Anatomy of PHP5 Exception class
- Extending the Exception class
- A note on unhanded exceptions
In this tutorial we will cover the following:
In this PHP tutorial we will understand the following:
In this tutorial you will learn all about static data members and methods
In this tutorial we will learn the following:
In this PHP5 tutorial you will learn about methods and how to declare and use them in PHP5 class.
Definition of an class method
A class method/functions is the behavior/functionality of a class i.e. they provide the necessary code for the class in which it is defined. Examples could be a saveCustomer() method in the class Customer or a printDocument() in the Document class.
Methods act (perform operations) on the data members of the class and can be declared as private or public. A class method is exactly similar to PHP functions, it’s just that class functions are declared inside classes and accessed using the -> (arrow operator / dereferencing operator).
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 script. The best place to put the autoload() file is in your configuration file which is loaded in all your other scripts.
Read more…