Re: Class & Type Casting

From: Date: Wed, 11 Jun 2008 07:33:22 +0000
Subject: Re: Class & Type Casting
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-275220@lists.php.net to get a copy of this message
> One could ask if it would just pass to > the constructor, but it doesn't. I don't know if there's a technical > reason > for that or if just no one implemented it, but the short answer is "The > language doesn't do that." That's what i was asking about, when trying to "cast" something into a non native type ( ie a class ), just fire the constructor. Would'nt it be great ? $myvar=(array) somefunc(); $myvar=(myarrayextented) somefunc(); ( what should be exactly the same as ) $myvar=new myarrayextented(somefunc()); But with a lot more of coolness !

« previous php.general (#275220) next »