Never miss a beat

Join my newsletter.

Tag: arrow functions

Arrow Functions in PHP 7.4+

Published: 3/31/2020

PHP is finally getting arrow functions (also known as Short Closures)! I know, I know. I’m just as excited as you are. Here’s everything you need to know about arrow functions in PHP. First, arrow functions are an approved RFC for PHP 7.4. If you’re using a version of PHP that’s lower than 7.4, you won’t be able to use arrow functions. Second, arrow functions can only contain one single expression. The goal with arrow functions ( as stated in the RFC ) is to help reduce verbosity and multi-line…