On Wed, 23 Jan 2019 at 17:25, Girgias <george.bany...@gmail.com> wrote:

> I understand the rationale for functional programming, may I ask
> in your opinion should PHP have built-in functions for arithmetic
> operations so that it can be used in such a way without needing userland
> implementations?

No, but only I'd much strongly prefer we have some syntax for defined
'short closures' ala Javascript:

$values = [1, 2, 3];
$bar = array_map($x => $x + 1, $values);

// $values === [2, 3, 4];

as those cover much more than the basic arithmetic operations, are
nice and readable after you've used them a few times.

cheers
Dan
Ack

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

Reply via email to