I came a cross this line of code in Codeigniter HMVC extension (by Wiredesignz), where a class got instantiated without getting assigned to a variable (class CI in Base.php)
The code :
class CI extends CI_Controller
{
public static $APP;
public function __construct() {
/* assign the application instance */
self::$APP = $this;
global $LANG, $CFG;
/* re-assign language and config for modules */
if ( ! is_a($LANG, 'MX_Lang')) $LANG = new MX_Lang;
if ( ! is_a($CFG, 'MX_Config')) $CFG = new MX_Config;
parent::__construct();
}
}
/* create the application object */
new CI;
What's the name of this technique? What's the implication?