On Wed, Oct 22, 2014 at 2:51 AM, Andrea Faulds <a...@ajf.me> wrote:

>
> > On 21 Oct 2014, at 10:14, Dmitry Stogov <dmi...@zend.com> wrote:
> >
> > some notes:
> > - it's probably make sense to implement these function as a new
> opcode(s) in VM
>
> That could be an optimisation later, yes. I note that you’ve added
> function replacement with opcodes for certain commonly-used functions. We
> could make these functions use that. Then they’d still be usable as
> callbacks.
>

I may help with implementation, if RFC accepted.
(It would be better if ZEND_STRLEN, ZEND_TYPE_CHECK, etc were introduced in
first place instead of stlen(), is_long() and family).



> > - in case of conversion failure it's better to throw exception (to_int()
> returning FALSE is a pain).
>
> I am gradually warming to throwing an exception. An interesting idea I’ve
> had suggested on Twitter was by Matt Parker, who suggested that I add an
> optional 2nd argument. Without the argument, it throws an exception. With
> an argument, it returns that value (as a default) instead of throwing an
> exception.
>

Together with https://wiki.php.net/rfc/engine_exceptions_for_php7 throwing
exceptions would be the best choice. I would make it permanent, (without
optional areguments)

Thanks. Dmitry.


>
> --
> Andrea Faulds
> http://ajf.me/
>
>
>
>
>

Reply via email to