PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php use Carbon\Carbon; $numbers = [1, 2, 3, 4, 5]; // Anonymous function with array_map $squared = array_map(function($n) { return $n * $n; }, $numbers); // Arrow function with array_map $squaredArrow = array_map(fn($n) => $n * $n, $numbers); print_r($squared); print_r($squaredArrow);
Show:  
Copy Clear