Classes and objects are powerful OOP concepts - and PHP4 supportsthem too. This article explains some basic OO entities (including classes,constructors and extensibility) with examples of a table builder and aguestbook.
Given the class, it's now simple to spawn as many Automobiles as you like, and adjust the individual properties of each. Take a look:
// let's spawn a couple of cars
// this is mine...
$his = new Automobile;
$his->make = "Ferrari";
$his->colour = "Black";
$his->shape = "Cigar";
// ...and this is yours
$hers = new Automobile;
$hers->make = "Porsche";
$hers->colour = "Silver";
$hers->shape = "Torpedo";
// hey...i can dream, can't i
// i feel like taking mine out for a spin
// speed limit? you must be joking!
// joining me, are you?
// oops...was that a speed trap?
As the illustration above shows, once new objects are
defined, their individual methods and variables can be accessed and modified independent of each other. This comes in very handy, as the next few pages will show.