Arrow function ( fn )
A short one-line function.
Syntax
fn($p) => expression
Description
Short function with fn() => ... (PHP 7.4+). Used in places like array_map.
Example
Loading editor…
Expected output
36
When to use?
Quick transformations, arguments to array methods.