Stanislav Malyshev wrote:
> I'm not sure I understand - how array_reduce is related to having type
> hints? You could make array_reduce to do additional things, but that
> doesn't require introducing strong typing into php.

The relation between array_reduce and scalar type hints is that API
start to enforce certain types where they should not just because the
programmer thinks it is a good idea.

Currently the third parameter $initial of array_reduce only allows int.
So instead of allowing any zval and leaving it to the callback function
to deal with it a specific type is enforced. You can work around this by
checking for NULL inside the callback and initializing it there but that
does not work either if you use a built-in function as callback.

- Chris

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to