> 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.

> - 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.

--
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