rendered paste body<html> <head> <title>OOP test</title> </head> <body><?php// A test class class asbtest {// Constructor method public function __construct($foo) { echo '<p>Constructing an instance of '; echo get_class($this)."\n"; $this->Donkey = $foo; echo '<br />My Donkey is '; echo $this->Donkey; echo "</p>\n"; }// An ordinary method public function vet() { echo '<p>In method '.__METHOD__; $this->Donkey = 'Healthy'; echo '<br />My Donkey is '; echo $this->Donkey; echo "</p>\n"; } }// Main program echo "<h1>OOP test</h1>\n"; $bar=new asbtest('Unwell'); $bar->vet(); echo "<p>Job done!</p>\n";?> </body></html>