Re: Closure local return

From: Date: Mon, 03 May 2010 14:17:50 +0000
Subject: Re: Closure local return
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-48177@lists.php.net to get a copy of this message
Of course I am. take a look at: http://en.wikipedia.org/wiki/Closure_%28computer_science%29 Section: Differences in semantics On 05/03/2010 03:27 PM, Jille Timmermans wrote:
Are you serious? Op 3-5-2010 15:01, mathieu.suen schreef:
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
-- • *Mathieu Suen* | It Team | www.easyflirt.com • mathieu [dot] suen [at] easyflirt [dot] com <mathieu%20[dot]%20suen%20[at]%20easyflirt%20[dot]%20com> • EasyFlirt - Park Nord, Les Pléiades, 74370 - Metz-Tessy - FRANCE • Pensez à l'environnement, n'imprimez cet e-mail qu'en cas de réelle nécessité

« previous php.internals (#48177) next »