Posted on February 14th, 2008 by admin
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
Filed under: PHP, PHP Class Examples, PHP Code Examples, PHP Tutorials, PHP5 OOPS Tutorials | 2 Comments »
Posted on February 14th, 2008 by admin
In this PHP tutorial we will understand the following:
Meaning of Final Class
Meaning of Final Method
When to declare a class as final
When to declare a method as final
Filed under: PHP, PHP Class Examples, PHP Tutorials, PHP5 OOPS Tutorials | No Comments »
Posted on February 12th, 2008 by admin
In this tutorial you will learn all about static data members and methods
Meaning of static data members
Meaning of static methods
Defining static data members in PHP5
Defining static methods in PHP5
Accessing static data members in PHP5
Accessing static methods in PHP5
Rules to keep in mind for static methods
[…]
Filed under: PHP, PHP Class Examples, PHP Tutorials, PHP5 OOPS Tutorials | 1 Comment »
Posted on February 11th, 2008 by admin
In this tutorial we will learn the following:
Meaning of Polymorphism
Why method polymorphism cannot be achieved in PHP
PHP 5 Object Polymorphism
Filed under: PHP, PHP Class Examples, PHP5 OOPS Tutorials | 7 Comments »
Posted on February 3rd, 2008 by admin
In this post, we learn what is an abstract class and an interface.
What is an Abstract Class?
Private methods cannot be Abstract
What is an Interface?
Defining an Interface
Abstract Class v/s Interface
Filed under: PHP, PHP5 OOPS Tutorials | 6 Comments »
Posted on November 15th, 2007 by admin
In the tutorial we will understand what is Inheritance in general and how to inherit classes in PHP5.
Definition of Inheritance:
Inheritance is the mechanism of deriving a new class from an existing class. It allows a sub-class / child class to share/inherit the attributes and behaviors of a base-class or parent class. These inherited attributes and […]
Filed under: PHP, PHP Tutorials, PHP5 OOPS Tutorials | No Comments »
Posted on November 15th, 2007 by admin
In PHP4 the only constants that we would declare were global constants. In PHP5 it is possible to define a class level constant. These constants are specific to the class and hence don’t clutter the global level constant space.
[…]
Filed under: PHP, PHP Tutorials, PHP5 OOPS Tutorials | 1 Comment »
Posted on November 15th, 2007 by admin
PHP5 introduces a new operator by the name of instanceOf. instanceOf is used to check if two objects passed as operands belong to the same class. This check can also happen when an object is compared with a class name.
In PHP4 a similar functionality existed with a method is_a(), which has been replaced by the […]
Filed under: PHP, PHP Tutorials, PHP5 OOPS Tutorials | 1 Comment »
Posted on November 14th, 2007 by admin
$this variable is a pointer to the object making the function call. $this variable is not avialable in static methods. We will learn more about static methods in the next series of tutorials.
Filed under: PHP, PHP Tutorials, PHP5 OOPS Tutorials | 1 Comment »
Posted on November 14th, 2007 by admin
PHP5 Introduces Method Type Hinting. Type Hinting allows a function to force parameters to be objects of a particular class by specifying the name of the class in the function prototype.
Type Hinting is optional in all cases except catch block.
[…]
Filed under: PHP, PHP Tutorials, PHP5 OOPS Tutorials | 1 Comment »