note 19601 deleted from ref.classobj by didou
| From: | didou@php.net | Date: | Mon, 01 Mar 2004 11:50:50 +0000 |
| Subject: | note 19601 deleted from ref.classobj by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66031@lists.php.net to get a copy of this message | ||
Note Submitter: saryon_no_spam_@unfix dot o r g
----
Something nice i found out when i was trying to do with classes what i knew could be done with
functions: they can be dynamically loaded/used.
ex:
class a
{
function bla()
{
echo "1\n";
}
}
class b
{
function bla()
{
echo "2\n";
}
}
$class = "a";
$test = new $class;
$test->bla();
$class2 = "a";
$test2 = new $class2;
$test2->bla();
-----------------------
This will print:
1
2
------------------
For those of you who were considering doing something with plugins....use this to your
advantage :)
makes life soooo easy, this :)
Sar