Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61579 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 708 invoked from network); 20 Jul 2012 20:46:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jul 2012 20:46:18 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:52691] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2E/FD-18983-893C9005 for ; Fri, 20 Jul 2012 16:46:17 -0400 Received: by lbgc1 with SMTP id c1so6280105lbg.29 for ; Fri, 20 Jul 2012 13:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=ZVPWEUTWapQbDZMlysIpPpTb1sNFj+71fePiy+Yx9xU=; b=i2YD/8XgnwfrxkhJTeEqC88HOTTted6dWBnAh0LoFpKZM7Z3ti2krzxP1CT0djbIf/ rkS2MIAmzZ8ffLZSgvBboDg5etljHCA9jSeepwprHfXthj9TA5Mqrlwy/DpriMRG1Ue9 8Bwu8GXDye+qSmYtt50UQnsQE5VlnypVeC0sDIoOzgy66/J7dws8lcdtlThA8Qbl/ke8 UmhLIeYuOQT2Q9zW0ma+k7/ML59l7GPxoTsi1Vr6ktKvfntHrtOoVGTJatyxZcwl+el+ 8HQ0LgHkKcq7ehvW6Fc2YsVox84QVFqQSaAIOtHSw/ruOoZBbaPglD5MVnn1CF7nip2f Mp4g== MIME-Version: 1.0 Received: by 10.152.105.173 with SMTP id gn13mr7682155lab.20.1342817173279; Fri, 20 Jul 2012 13:46:13 -0700 (PDT) Received: by 10.152.114.70 with HTTP; Fri, 20 Jul 2012 13:46:13 -0700 (PDT) In-Reply-To: References: Date: Fri, 20 Jul 2012 22:46:13 +0200 Message-ID: To: Nikita Popov Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: Generators in PHP From: nikita.ppv@gmail.com (Nikita Popov) On Tue, Jun 5, 2012 at 7:35 PM, Nikita Popov wr= ote: > Hi internals! > > In the last few days I've created a proof of concept implementation > for generators in PHP. It's not yet complete, but the basic > functionality is there: > https://github.com/nikic/php-src/tree/addGeneratorsSupport > > The implementation is outlined in the RFC-stub here: > https://wiki.php.net/rfc/generators A small progress update on this: * There now is support for yield by reference * Generators are now automatically detected by the presence of "yield" instead of requiring the "*" modifier. The main open point I still have is whether or not generators should have a throw() method (=E1 la Python). I couldn't yet find a convincing use case for it, so I'm considering to just leave it out. If there is any further feedback on the proposal, I'd love to hear it :) Nikita