One way to call a anonymous function recursively is to use the USE keyword and pass a reference to the function itself:
<?php
$count = 1;
$add = function($count) use (&$add){
$count += 1;
if($count < 10) $count = $add($count); //recursive calling
return $count;
};
echo $add($count); //Will output 10 as expected
?>