Zamknięcie php fn
// A collection of Post objects
$posts = [/* … */];
$ids = array_map(fn($post) => $post->id, $posts);
Coffee Coder
// A collection of Post objects
$posts = [/* … */];
$ids = array_map(fn($post) => $post->id, $posts);
Closure {
/* Methods */
private __construct()
public static bind(Closure $closure, object|null $newThis, object|string|null $newScope = "static"): Closure|null
public bindTo(object|null $newThis, object|string|null $newScope = "static"): Closure|null
public call(object $newThis, mixed ...$args): mixed
public static fromCallable(callable $callback): Closure
}