Re: Inline typecasting / typehinting for classes and interfaces

From: Date: Wed, 15 Aug 2012 11:48:51 +0000
Subject: Re: Inline typecasting / typehinting for classes and interfaces
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-62190@lists.php.net to get a copy of this message
Stan, On Wed, Aug 15, 2012 at 3:57 AM, Stan Vass <sv_forums@fmethod.com> wrote: > 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. >> > > The discussion is starting to drift very far from my original proposal. > > Instead of trying to guess what I mean, can't people just refer to my very > simple definitive proposed behavior? > My point was that what I posted was the only way that I can see for the original proposal to be useful. Anthony

« previous php.internals (#62190) next »