RE: [PHP-DEV] [RFC] Custom Casting
| From: | Clint Priest | Date: | Sun, 13 May 2012 23:27:25 +0000 |
| Subject: | RE: [PHP-DEV] [RFC] Custom Casting | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60556@lists.php.net to get a copy of this message | ||
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]
> Sent: Wednesday, May 09, 2012 4:56 PM
> To: 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 at 6:14 PM, Yasuo Ohgaki <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
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List To unsubscribe,
> > visit: http://www.php.net/unsub.php
> >
> >