<slide>
<title>PHP 8.5: Closures in Constant Expressions</title>

<example><![CDATA[<?php
final class Country
{
	$[\Validator\Custom(static function ($countryCode) {
		return \preg_match('/^[a-z]{2,3}$/', $countryCode);
	})]
	public string $countryCode;
}
?>]]></example>

<list>
    <bullet>They must be %static%</bullet>
    <bullet>They may not include variables from the surrounding scope.</bullet>
	<bullet>*Forbidden:* %use($foo)%</bullet>
	<bullet>*Forbidden:* short closures: %fn() => …%</bullet>
</list>

</slide>
