Re: Re: Closure local return
| From: | mathieu.suen | Date: | Mon, 17 May 2010 09:48:43 +0000 |
| Subject: | Re: Re: Closure local return | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-48303@lists.php.net to get a copy of this message | ||
On 05/03/2010 05:42 PM, Christian Schneider wrote:
mathieu.suen wrote:May be it could be interesting to have a syntax for returning from the define scope. For example. $findedElment = $myList->selectIfAbsent($fooo, function(){I think you actually misunderstand the difference in http://en.wikipedia.org/wiki/Closure_%28computer_science%29#Differences_in_semantics The way I read if the difference is wether it returns from the closure function or the surrounding function *calling* it. Not the *defining* scope. And no, it doesn't make sense in the PHP context IMHO. You need to give me more argument on that point.return 'No item founded'; //Retrun from the define scope}) //Do somthing with $findedElment
- Chris-- Mathieu Suen