note 57248 deleted from language.oop by danbrown
| From: | danbrown@php.net | Date: | Sat, 07 Nov 2009 19:03:24 +0000 |
| Subject: | note 57248 deleted from language.oop by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162561@lists.php.net to get a copy of this message | ||
Note Submitter: ia [AT] zoznam [DOT] sk
----
to Menno Vanderlist:
And why bother to use eval?
<?php
class mainClass
{ //mainClass
var $module;
function mainClass($loadModule)
{ // load modules
//eval("\$this->module = new $loadModule;");
$this->module = new $loadModule; // this is much better
}
function out()
{ //print out of loaded module
$this->module->out();
}
}
?>
Functionality is the same, without the overhead when using eval().