Date: 03/27/01
- Next message: Leonard Coonan: "[phplib] PHP 4"
- Previous message: Bogdan Morar: "[phplib] Object instance"
- In reply to: Bogdan Morar: "[phplib] Object instance"
- Next in thread: Bogdan Morar: "Re: [phplib] Object instance"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello Bogdan,
Tuesday, March 27, 2001, 10:49:04 AM, you wrote:
BM> In my file I can have:
BM> $objXYZ = new XYZ;
BM> but my question is about creation like this:
BM> $tmp = "XYZ";
BM> $objXYZ = new $tmp;
Right, that will work.
BM> Are some method to build an object starting with the class name?
BM> (like $objXYZ = new Class($tmp); ???? )
class Foo {
function Foo($tmp) {
$this = new $tmp;
}
}
$objXYZ = new Foo($tmp);
That will give you an instance of the class with name stored in the
$tmp variable.
-- Best regards, Maxim Derkachev mailto:kot <email protected> Symbol-Plus Publishing Ltd. phone: +7 (812) 324-53-53 http://www.Books.Ru -- All Books of Russia--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>
- Next message: Leonard Coonan: "[phplib] PHP 4"
- Previous message: Bogdan Morar: "[phplib] Object instance"
- In reply to: Bogdan Morar: "[phplib] Object instance"
- Next in thread: Bogdan Morar: "Re: [phplib] Object instance"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

