note 1497 deleted from Classes and Objects by ronabop
| From: | ronabop@php.net | Date: | Thu, 17 Aug 2000 09:55:08 +0000 |
| Subject: | note 1497 deleted from Classes and Objects by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-2152@lists.php.net to get a copy of this message | ||
Can classes contain other classes? Possible one of itself? I tried this but
couldn't get it to work:
<?
class pouch {
var $color;
var $items;
function add_pouch($mypouch) {
${$mypouch} = new pouch;
}
}
$bigpouch = new pouch;
$bigpouch->color = "brown";
$bigpouch->add_pouch("smallpouch");
$bigpouch->$smallpouch->color = "green";
?>
[the last line above gave a parse error]
Any ideas?