PHP 8.5 Closures in Constant Expressions

PHP 8.5 enables closures in constant expressions, allowing default function parameters, attribute values, and class constants to be defined as closures without workarounds.

LG

Lauro Guedes

lauroguedes•Oct 26, 2025
PHP
php-8.5
closures
constant-expressions
default-parameters
attributes
type-safety
modern-php
254
0
1