new {$var.$var} not possible...
| From: | waldschrott | Date: | Mon, 19 Jun 2000 12:17:18 +0000 |
| Subject: | new {$var.$var} not possible... | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-21721@lists.php.net to get a copy of this message | ||
Hi, creating a list of instances from classes held in an array it´s not possible to do
<?php
foreach ($this->active_parse_objects AS $object) {
$this->$object = new {$this->active_parse_prefix.$object}; }
?>
OR
<?php
foreach ($this->active_parse_objects AS $object) {
$this->$object = new $this->active_parse_prefix.$object; }
?>
INSTEAD you´ll have to copy it to another variable first
<?php
foreach ($this->active_parse_objects AS $object) {
$classname=$this->active_parse_prefix.$object;
$this->$object = new $classname; }
?>
am I doing something wrong or is it just a limitation....
regards
--
o----------0-¬---------O-·---¬----o---®-----o o O ° . | http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ ° ·0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ ° o © ° . ·
| psychedelic experience | gott@kiffen.de | O ° o °o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·