note 9441 added to Variable variables
| From: | webdev at flyerware dot com | Date: | Fri, 03 Nov 2000 04:08:18 +0000 |
| Subject: | note 9441 added to Variable variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7331@lists.php.net to get a copy of this message | ||
Is it possible to create a new class via variable variables? For example:
class foo{
function fooit(){
}
}
$test = "foo";
${$test} = new {$test};
// but that doesn't work so I tried...
${$test} = new "$test";
// but this doesn't work also...
-Jonathan
http://www.php.net/manual/language.variables.variable.php