Hiya :)
After a couple of years I have decided to start programming again and trying to catch up with php5. I have come across a bit of coding that I don't quite understand and would like if someone can tell me exactly what is going on here. :)
This is my sample of what I have come across:
/**
*/
class myDatabase {
/**
* Constructor
*/
function __construct()
{
}
}
/**
*/
class MyParentClass {
/**
* Constructor
*/
public function __construct()
{
}
}
/**
*/
class myChildClass extends MyParentClass {
/**
* Constructor
*/
public function __construct( myDatabase $database = null )
{
$this->database = $database;
}
}
As you can see, 3 classes at work here. I would like to know why the myDatabase class name is in the myChildClass construct parentheses and what is this purpose of this?
Many thanks and nice forum btw :)
DTMP