Re: Class & Type Casting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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 ! 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux