Thx for quick reply,
If I use the following:
$object = new {classname};
I get this a parse error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE'
or `'$'' in
/home/sites/projects.virtuosys.nl/web/cm/includes/class_crm.inc.php on
line 29
>From that I conclude that with this method its not possible to create an
object from a variable class name
Michiel ten Hagen
[EMAIL PROTECTED]
06-54673863
-----Oorspronkelijk bericht-----
Van: Mathieu Dumoulin [mailto:[EMAIL PROTECTED]]
Verzonden: Wednesday, July 24, 2002 3:11 PM
Aan: [EMAIL PROTECTED]
Onderwerp: Re: create object from variable class.
Simple, you made an error here
You are telling the new operator to look into a variable to get the
classname, to specify the class name as a string do this:
$object = new {$classname};
InsaneCoder
Ps: I never tried this, but I think it is actually going to work, you
got nthing to lose anyway I guess, takes two seconds to try.
"Karel De Groot" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
> Is it possible to create an object from a clas which name is in a
> variable.
>
> Example: (doesn't work)
> $object = new ${$classname};
>
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php