RE: [PHP-DEV] [RFC] Custom Casting

From: Date: Mon, 14 May 2012 19:31:50 +0000
Subject: RE: [PHP-DEV] [RFC] Custom Casting
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-60587@lists.php.net to get a copy of this message
How would one use your Castable interface to cast a Class "Test" to any of integer, array or boolean? From: Seva Lapsha [mailto:seva.lapsha@gmail.com] Sent: Monday, May 14, 2012 12:19 PM To: Clint Priest Cc: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] Custom Casting My pastbin is for casting anything to anything. On Mon, May 14, 2012 at 11:24 AM, Clint Priest <cpriest@zerocue.com<mailto:cpriest@zerocue.com>> wrote: Both of the RFC's you reference are for casting TO a scalar, not TO an object type. Your pastbin is for casting FROM a scalar TO an object. -----Original Message----- From: Seva Lapsha [mailto:seva.lapsha@gmail.com<mailto:seva.lapsha@gmail.com>] Sent: Monday, May 14, 2012<tel:2012> 6:18 AM To: Clint Priest Cc: internals@lists.php.net<mailto:internals@lists.php.net> Subject: Re: [PHP-DEV] [RFC] Custom Casting Sorry, I comprehend neither the cause nor the effect in your argument statement. Can you please elaborate? On Sun, May 13, 2012<tel:2012> at 7:27 PM, Clint Priest <cpriest@zerocue.com<mailto:cpriest@zerocue.com>> wrote: > This has already been covered quite a bit, the problem with your > suggestion is that the compiler needs to determine the type it is cast > to, which is why the __toInt(), __toArray(), etc, so that the language > can request the type it needs to cast to. > > > -----Original Message----- > > From: Seva Lapsha > > [mailto:seva.lapsha@gmail.com<mailto:seva.lapsha@gmail.com>] > > Sent: Wednesday, May 09, 2012<tel:2012> 4:56 PM > > To: internals@lists.php.net<ËøžåáúÒ > > é»mailto:internals@lists.php.net> > > Subject: [PHP-DEV] [RFC] Custom Casting > > > > Hello All, > > > > Please be kind to review and comment my proposal for custom casting > > in > PHP (or let me know if a similar proposal was already > > discussed). > > > > http://pastebin.com/sPb0i8U6 > > > > IMHO, it's more simple and on the other hand more flexible than > > proposed > in: > > > > https://wiki.php.net/rfc/object_cast_to_types > > https://wiki.php.net/rfc/class_casting_to_scalar > > > > Thank you in advance, > > Seva Lapsha > > > > On Wed, Apr 11, 2012<tel:2012> at 6:14 PM, Yasuo Ohgaki > > <yohgaki@ohgaki..net<mailto:yohgaki@ohgaki.net>> > wrote: > > > > > Hi all, > > > > > > I think my RFC confused people on this list due to improper > > > descriptions and too much information. Sorry for the confusion. I > > > revised the RFC so that most important points can be understood at > > > a > glance. > > > > > > https://wiki.php.net/rfc/nophptags > > > > > > Please read again if you've read already and give comments. > > > Thank you. > > > > > > -- > > > Yasuo Ohgaki > > > yohgaki@ohgaki.net<mailto:yohgaki@ohgaki.net> > > > > > > -- > > > PHP Internals - PHP Runtime Development Mailing List To > > > unsubscribe, > > > visit: http://www.php.net/unsub.php > > > > > > >

« previous php.internals (#60587) next »