Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:48176 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14095 invoked from network); 3 May 2010 13:33:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 May 2010 13:33:13 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.216 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.218.216 mail-bw0-f216.google.com Received: from [209.85.218.216] ([209.85.218.216:35149] helo=mail-bw0-f216.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/A0-09795-690DEDB4 for ; Mon, 03 May 2010 09:33:11 -0400 Received: by bwz8 with SMTP id 8so1344021bwz.23 for ; Mon, 03 May 2010 06:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=FYPauAoCJpOjpMXN9hgv9kELX1pnVmpVkw2SHdghHik=; b=VbfCZBUhyfjKf8nbw3j2o4Av9WY2S0/n7ENbIB1QFYAu/z9tNaObaIjnD4/YJFDqci zO0corrUYQy6ZBnehgx5L5dwfAKW3eAOA2Aa5wr+pFCxkKohFWhpQc2XDz6UzUzWUV+f rMoVvbzTq9CSatJact0+4M6HK4ywauzWJ8Ruo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=ualtgNYpoCmVpNJ17ZYK3rEj/hxzQQL71zQCLyT7PFj226Qz6hQO1parvgOaClAUBb XAhN2zgRDEiRv5RLucKOqtI6X2OxzuU05Mxh7URwsuIziIr8vfknuDCUqDjIQmJF8YVM 5RvA+BXNgVgfCHtV4/OhKQ8YcpGi763/g2k/8= MIME-Version: 1.0 Received: by 10.204.152.13 with SMTP id e13mr9826080bkw.30.1272893586018; Mon, 03 May 2010 06:33:06 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.204.56.72 with HTTP; Mon, 3 May 2010 06:33:05 -0700 (PDT) In-Reply-To: <4BDEC91F.9080305@easyflirt.com> References: <4BDEC91F.9080305@easyflirt.com> Date: Mon, 3 May 2010 15:33:05 +0200 X-Google-Sender-Auth: d3fe80430a73da63 Message-ID: To: "mathieu.suen" Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Closure local return From: webmaster@colder.ch (Etienne Kneuss) Hello, On Mon, May 3, 2010 at 3:01 PM, mathieu.suen w= rote: > 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 =A0scope 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 =3D $myList->selectIfAbsent($fooo, function(){ > =A0 =A0return 'No item founded'; //Retrun from the define scope > }) > //Do somthing with $findedElment uh? Could you please provide a clear example of what you mean, in contrast of how it works now. "return" returns to just after the call, returning somewhere else doesn't make much sense IMHO. > > So =A0I am asking if there has been some discussion on it or if it could = be > =A0added? > > Thanks > > --Mathieu Suen > > > > --=20 Etienne Kneuss http://www.colder.ch