Object model is brand spanking new!
Private and Protected member variables are now available
You are able to make direct copies of objects with PHPv5, furthermore
you can define functions that are called when the objects are copied.
In PHPv5 you can have classes within classes. This allows for many
neat features, most importantly, classes can function as namespaces.
Classes may now contain constants
]]>
You may now import class symbols into the current "namespace"
]]>
The new OO model will allow for consistency amongst constructors and
destructors, so they are no longer dependent on they class name (PHPv4
actually only had the concept of constructors.)
name = 'MyDestructableClass';
}
function __destruct() {
print 'Destroying ' . $this->name . "\n";
}
}
$obj = new MyDestructableClass();
?>]]>
The new OO model will support exceptions ala Java
You can now directly dereference objects
returned from functions.
draw();
ShapeFactoryMethod('Square')->draw();
?>]]>