Welcome Guest, Not a member yet? Register   Sign In
Question about pointers(or references, whatever you call them) in the Core. CI2.0?
#1

[eluser]VicToMeyeZR[/eluser]
I have a dumb question?

Why does the core in 2.0 still use them? Isn't 2.0 for php5+? and can someone tell me the logic behind using it?

For example. The Controller.php file in Core.

Code:
public static function &get;_instance()
{
    return self::$instance;
}

Also, with that file we are assuming that __construct() will ALWAYS run before static functions? Should we be making that assumption?

Would this not be better?

Code:
public static function get_instance()
{
   if (null === self::$_instance) {
     self::$_instance = new self();
   }

   return self::$instance;
}




Theme © iAndrew 2016 - Forum software by © MyBB