Hi,

The statement 'return' in a closure is now returning from the scope that evaluate the closure (evaluation scope).
It could have been in an other way.
It could mean return from the scope were the closure is create (define scope).

May be it could be interesting to have a syntax for returning from the define scope.
For example.

$findedElment = $myList->selectIfAbsent($fooo, function(){
    return 'No item founded'; //Retrun from the define scope
})
//Do somthing with $findedElment

So I am asking if there has been some discussion on it or if it could be added?

Thanks

--Mathieu Suen

        

Reply via email to