My attempt on functional programming in PHP
phel-lang.org
phel-lang.org
https://www.php.net/manual/en/functions.anonymous.php
It's not idiomatic to do so, but you can totally write sort of functional PHP nowadays without any tricks. Stuff like `array_map` exists since PHP 4.
$inc = function($number) {
return $number + 1;
};
$x = [1, 2, 3, 4];
array_map($inc, $x);$inc = fn ($number) => $number + 1;
$x = [1, 2, 3, 4];
array_map($inc, $x);