Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php arrow function

// Arrow functions were added for PHP 7.4+
$y = 1;

// this arrow function:
$fn1 = fn($x) => $x + $y;

// is equivalent to using $y by value:
$fn2 = function ($x) use ($y) {
    return $x + $y;
};
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php #arrow #function
ADD COMMENT
Topic
Name
3+8 =