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

stitcher.io:
Short closures in PHP
May 02, 2019 @ 17: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...

tagged:

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


Trending Topics: