Objects represent singular instances of a specified class.
To initialize an object instance, use the new keyword:
new
<?php
$obj = new Simple;
?>
If the class has a constructor, simply add your function
arguments to the classname:
Constructor
<?php
$obj = new Simple ('hallo world');
?>
To access object properties, use the '->' specifier:
Properties
<?php
$obj = &new Simple ('hallo world');
print $obj->someprop;
?>
To access object methods, you can also use the '->' specifier:
Methods
<?php
$obj = &new Simple ('hallo world');
print $obj->someprop . "\n<br>\n";
print $obj->somemethod ();
?>