PHPackages                             uuf6429/expression-language-arrowfunc - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. uuf6429/expression-language-arrowfunc

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

uuf6429/expression-language-arrowfunc
=====================================

Arrow function support in Symfony Expression Language

v0.1.0-alpha(9y ago)3123[2 issues](https://github.com/uuf6429/expression-language-arrowfunc/issues)[1 PRs](https://github.com/uuf6429/expression-language-arrowfunc/pulls)MITPHPPHP &gt;=5.5.9CI failing

Since Oct 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/uuf6429/expression-language-arrowfunc)[ Packagist](https://packagist.org/packages/uuf6429/expression-language-arrowfunc)[ Docs](http://github.com/uuf6429/expression-language-arrowfunc)[ RSS](/packages/uuf6429-expression-language-arrowfunc/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

Symfony Expression Language Arrow Function
==========================================

[](#symfony-expression-language-arrow-function)

[![Build Status](https://camo.githubusercontent.com/c53ea935e12e0cdecbb3bd26eee7341d5087f7d4769b9b1c60fcefce27d0d740/68747470733a2f2f7472617669732d63692e6f72672f757566363432392f65787072657373696f6e2d6c616e67756167652d6172726f7766756e632e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/uuf6429/expression-language-arrowfunc)[![Minimum PHP Version](https://camo.githubusercontent.com/824c5c4ccb56537db3b3b53bb43d7b8edc6286f3b3d1705525e0821dfd22d27e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e312d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/uuf6429/expression-language-arrowfunc/master/LICENSE)[![Coverage](https://camo.githubusercontent.com/37f797986f0f053ec32a524086d6ee0e57d3d44a41fc090912ec1d8dbfa698ab/68747470733a2f2f636f6465636f762e696f2f67682f757566363432392f65787072657373696f6e2d6c616e67756167652d6172726f7766756e632f6272616e63682f6d61737465722f67726170682f62616467652e7376673f746f6b656e3d4275326e4b324b713737)](https://codecov.io/github/uuf6429/expression-language-arrowfunc?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4f6bbe142415dadd9494c877f120bad69e0d43c3ba4c816d475bbc19dcc6f7cb/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f757566363432392f65787072657373696f6e2d6c616e67756167652d6172726f7766756e632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/uuf6429/expression-language-arrowfunc/?branch=master)[![Packagist](https://camo.githubusercontent.com/c0c6c1737d5e4132f2126ab12745ae454aaac51df6c8083b511a1ee0a4346f23/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f757566363432392f65787072657373696f6e2d6c616e67756167652d6172726f7766756e632e737667)](https://packagist.org/packages/uuf6429/expression-language-arrowfunc)

Arrow function (aka "Lambda Expression" or "Anonymous Function") support in Symfony [Expression Language component](https://symfony.com/doc/current/components/expression_language.html).

Syntax
------

[](#syntax)

```
 (a) -> { a * 2 }
  ^  ^      ^
  |  |      '----- Function body is a single expression that can make use of passed parameters or global variables.
  |  '------------ The lambda operator - input parameters are to the left and the output expression to the right.
  '--------------- Comma-separated list of parameters passed to arrow function.

```

Safety
------

[](#safety)

Returning callbacks can be dangerous in PHP. If the returned value is not checked, PHP may end up executing arbitrary global functions, static class methods or object methods.

### Problem Example

[](#problem-example)

```
$language = new ExpressionLanguage();
$expression = '(value) -> { value > 20 }';
$filter = $language->evaluate($expression);
$values = array_filter([18, 23, 40], $filter);
```

If `$expression` returns a string or array, `array_filter()` will arbitrarily call whatever was returned.

### Solution

[](#solution)

There are two solutions:

- Set the type declaration of methods using the callback to `Closure` (*not `Callable`!*) - prone to mistakes and quite risky.
- The engine returns the callback wrapped in an object that cannot be invoked by default - this is the safest option (and default one).

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3532d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/450767af6ef832ad662c169bf718d6d25c025c08b2d91b810959d190bccebba1?d=identicon)[uuf6429](/maintainers/uuf6429)

---

Top Contributors

[![uuf6429](https://avatars.githubusercontent.com/u/230049?v=4)](https://github.com/uuf6429 "uuf6429 (11 commits)")

---

Tags

arrow-functionsexpression-languagephpsymfonysyntaxuuf6429symfonylanguageexpressionfunctionArrowuuf6429

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/uuf6429-expression-language-arrowfunc/health.svg)

```
[![Health](https://phpackages.com/badges/uuf6429-expression-language-arrowfunc/health.svg)](https://phpackages.com/packages/uuf6429-expression-language-arrowfunc)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k69](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k18](/packages/solspace-craft-freeform)[typo3/cms-form

TYPO3 CMS Form - Flexible TYPO3 frontend form framework that comes with a backend editor interface.

147.6M265](/packages/typo3-cms-form)[uuf6429/rune

PHP Rule Engine.

7011.8k](/packages/uuf6429-rune)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
