Re: Inline typecasting / typehinting for classes and interfaces
| From: | Stas Malyshev | Date: | Tue, 14 Aug 2012 17:11:06 +0000 |
| Subject: | Re: Inline typecasting / typehinting for classes and interfaces | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62149@lists.php.net to get a copy of this message | ||
Hi!
> I agree with you. The one case where this syntax may be very useful is if
> we want to implement class casting. So introduce a pair of magic methods
I do not think we want to implement class casting. I'm not sure how
class casting even makes sense - if the object is of one class, how can
you just make it into another class by casting? If you mean "casting"
actually returns another object of different class, then just make a
method for that that returns that object, I do not see how obscuring the
purpose of this operation with unobvious syntax would help.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227