Re: [phplib] Object instance From: nathan r. hruby (nhruby <email protected>)
Date: 03/27/01

On Tue, 27 Mar 2001, Bogdan Morar wrote:

> Hello,
>
> Supose I have a class which extend DB_Sql. Can I create an object
> starting with the class name?
>
> An example is:
> class XYZ extend DB_Sql {
> var $classname = "XYZ";
> ...
> }
>
> In my file I can have:
>
> $objXYZ = new XYZ;
>
> but my question is about creation like this:
>
> $tmp = "XYZ";
> $objXYZ = new $tmp;
>

Yes, you can do this in php4. (Never tried in php3)

-n

-- 
......
nathan hruby - nhruby <email protected>
computer support specialist
department of drama and theatre
http://www.drama.uga.edu/
......

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>