Featured Posts

Writing Website Scrapers in PHPWriting Website Scrapers in PHP This article discusses about how to write a website scraper using PHP for web site data extraction. The concepts taught can be applied and programmed in Java, C#, etc. Basically any language that has a...

Readmore

12 common programming mistakes to avoid12 common programming mistakes to avoid Programming is an art and science and like all art and science the only way to learn is from mistakes. I have made many... and I would like to share with you the mistakes that I have made over my journey...

Readmore

7 habits of highly effective freelance programmers7 habits of highly effective freelance programmers I have developed these based on my freelancing experience. Though I have discontinued freelancing, but would like to share my practices with you. These are basic practices and have been developed over...

Readmore

  • Prev
  • Next

PHP 5 Tutorial - Handling Exceptions in PHP5

Posted on : 14-02-2008 | By : admin | In : PHP, PHP Class Examples, PHP Code Examples, PHP Tutorials, PHP5 OOPS Tutorials

2

If you're new here, you may want to subscribe to my Newsletter. Thanks for visiting!

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

PHP 5 Tutorial - Final Class and Methods

Posted on : 14-02-2008 | By : admin | In : PHP, PHP Class Examples, PHP Tutorials, PHP5 OOPS Tutorials

6

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

PHP 5 Tutorials - Static Data Members and Methods

Posted on : 12-02-2008 | By : admin | In : PHP, PHP Class Examples, PHP Tutorials, PHP5 OOPS Tutorials

2

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

PHP5 OOPS Tutorials - Polymorphism

Posted on : 11-02-2008 | By : admin | In : PHP, PHP Class Examples, PHP5 OOPS Tutorials

11

In this tutorial we will learn the following:

  • Meaning of Polymorphism
  • Why method polymorphism cannot be achieved in PHP
  • PHP 5 Object Polymorphism

PHP5 Tutorial - Defining Methods of a PHP5 Class

Posted on : 08-11-2007 | By : admin | In : PHP, PHP Tutorials, PHP5 OOPS Tutorials

8

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).

PHP5 Tutorial - Magic Methods - __autoload() method

Posted on : 03-11-2007 | By : admin | In : PHP, PHP Tutorials, PHP5 Magic Methods, PHP5 OOPS Tutorials

6

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.