Question 1
In CodeIgniter... I've seen some weird stuff... For example:
parent::__Construct(); with no parameters passed into it to load into the construct of the extended class.
I assumed it must be from older PHP versions... I don't really understand what the above would do... I only see value if you pass something into the construct of the extending class.
class Sausage
{
private $name;
function __Construct( $something )
{
$this->name = $something;
}
}
class Something extends Sausage
{
parent::__Construct( "Hi" );
echo $this->name; // outputs "Hi"
}
In Codeigniter, they do not pass anything into the parent::_Construct.. So I do not understand what purpose it serves :S
Question 2
Second of all, WHAT ON EARTH does this mean:
self::$instance =& $this;
In the following snippet from Code Igniter:
class CI_Controller {
private static $instance;
public function __construct()
{
self::$instance =& $this;
make the $instance variable equal the reference of $this?? $this doesn't account for anything in a static context? i'm confused.
Thanks for your help, totally making me go crazy here.