There is an array.
$report = array(); $report ['tasks'] = [ 'report_field' => '1', 'report' => function () { $i = 'ok'; return $i; } ]; It is necessary, using a closure, to assign a value to the key. In this case, report If you do a var_dump array, then I get object (Closure) # 1 (0) {} If I do echo $ report ['tasks'] ['report'] , then I get Error 500. Why then is there a closure in PHP or I don't understand something? For me, the utility of closures would be in the ability to process data before assigning them to an array key.