Thu, 20 Nov 2025 23:16:00 +0000
closures, attributes, php85, php

Really looking forward to be able to use #Closures in #Attributes with #php85.

<?php
$lol = #[Lol(#[Lol(#[Lol(#[Lol(static function () {
echo "Style";
})] static function () {
echo " ";
})] static function () {
echo "Passing";
})] static function () {
echo " ";
})] static function () {
echo "Continuation";
};

for (;;) {
$lol();
$a = (new ReflectionFunction($lol))->getAttributes();
if ($a === []) break;
$lol = $a[0]->getArguments()[0];
}
?>

#PHP