# symfony/expression-language

Provides an engine that can compile and evaluate expressions

Repository: https://github.com/symfony/expression-language
Canonical: https://ross.abutalabs.com/products/expression-language
Homepage: https://symfony.com/expression-language
Language: PHP
License: MIT
License Family: permissive
Topics: php, symfony, component, symfony-component
Last push: 2026-08-14T13:37:59+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 97, release rhythm 90, longevity 100
- inputs: {"age_days": 4730, "days_push": 19, "days_rel": 67, "gap_med": 0.0, "n_releases_24m": 25}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2840, forks 45 (observed 2026-08-28T04:07:24.725812+00:00)

## What it is
A Symfony PHP component providing an engine that compiles and evaluates one-line expressions with a syntax similar to PHP and Twig. It acts as a restricted sandbox for evaluating dynamic logic where raw PHP code cannot be used safely, such as in configuration, security rules, or user-editable business rules.

## Use cases
- evaluate dynamic expressions in PHP safely
- build a business rule engine editable by non-developers
- define access rules in security configuration
- add conditions to validation constraints
- store discount or pricing rules in a database
- evaluate route matching conditions
- lint and parse expression strings before evaluation

## When to choose
- you need to evaluate user- or admin-defined logic without executing arbitrary PHP
- you want a sandboxed expression engine with explicit variable declaration
- you are building a Symfony application and need expressions for security, validation, or routing
- you need compiled expressions for repeated fast evaluation

## When to avoid
- you need a full general-purpose scripting language
- your expressions require complex multi-line logic or loops
- you are not working in PHP

## Facets
- artifact type: library
- maturity: stable
- function: parser, interpreter, compiler, configuration-management, security
- domain: programming-languages, web-development, developer-tools
- platform: php, cross-platform
- tags: expression-language, symfony-component, rule-engine, sandboxed-evaluation, business-rules, automation

## Member repositories
- symfony/expression-language (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:24.725812+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:37:16.931127+00:00, confidence not recorded.
  - readme: https://github.com/symfony/expression-language (fetched 2026-08-28T04:07:24.725812+00:00, sha b2b5794d4a31)
  - homepage: https://symfony.com/expression-language (fetched 2026-08-29T09:52:54.751200+00:00, sha 48cc1ec6eff5)
  - site_page: https://symfony.com/doc (fetched 2026-08-29T09:52:54.760270+00:00, sha 44889134f4fb)
  - site_page: https://symfony.com/doc/current/components/expression_language.html (fetched 2026-08-29T09:52:54.762290+00:00, sha 75bbb259b05e)
  - site_page: https://symfony.com/releases (fetched 2026-08-29T09:52:54.764177+00:00, sha 2fd410222cfe)
  - site_page: https://symfony.com/blog/category/releases (fetched 2026-08-29T09:52:54.765887+00:00, sha 83b70dd163fb)
- Data as of 2026-08-30T08:39:29.467469+00:00.
