Both, the idea and implementation look fine.

Personally, I hate the existing type conversion rules, and I would like to
use something like this by default (may be with exception for
null/false/true handling), but it may be a big compatibility break, so
introducing to_int() is better than nothing.

some notes:
- it's probably make sense to implement these function as a new opcode(s)
in VM
- in case of conversion failure it's better to throw exception (to_int()
returning FALSE is a pain).

Thanks. Dmitry.

On Tue, Oct 21, 2014 at 2:57 AM, Andrea Faulds <a...@ajf.me> wrote:

> Good evening,
>
> I am presenting a new RFC to add a set of three functions to do validated
> casts for scalar types:
>
> https://wiki.php.net/rfc/safe_cast
>
> Please read it.
>
> Thanks!
> --
> Andrea Faulds
> http://ajf.me/
>
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to