Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Short closures in PHP
May 02, 2019 @ 12:30:02

Short closures, also called arrow functions, are a way of writing shorter functions in PHP. This notation is useful when passing closures to functions like array_map or array_filter.

This is what they look like: // A collection of Post objects $posts = [/* … */];

$ids = array_map(fn($p...


Link: https://stitcher.io/blog/short-closures-in-php

Trending Topics: