DEV Community

Programming Dive
Programming Dive

Posted on

1

Using Lambda and Closure functions in PHP

PHP 5.3 started with adding new features in PHP that change the game forever in the language. These are lambda functions/closures & namespaces. Here in this tutorial, we will explore lambda and closure functions in PHP with some practical examples.

In this tutorial, we’ll take a look into what is lambda function & closure with a coding example to understand easily.

So back in 2008, an RFC (Request for Comments) was proposed by Christian Seiler, Dmitry Stogov in which it is suggested that without support for closures, lambda functions are not useful enough to add them to PHP.

Lambda function plays an important role in the development of the closure function. First, we’ll understand about lambda function, and then we’ll see the relationship of it with closure.

https://programmingdive.com/lambda-and-closure-functions-in-php/

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay