Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61843 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43202 invoked from network); 27 Jul 2012 17:35:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jul 2012 17:35:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; 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:63847] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/6B-14209-241D2105 for ; Fri, 27 Jul 2012 13:34:59 -0400 Received: by lbgc1 with SMTP id c1so2561812lbg.29 for ; Fri, 27 Jul 2012 10:34:55 -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; bh=JNEVeN+fgA2eZD7R8EDkw0TtHAJWmVC51mCyHYlz1+M=; b=xeQuUkBJ+Qw1NAlwWBZKY607a8QbchUkBvu9oJkAt7x2XK+tL05Uq+6bq8OVRJaunk Uq52PE4d/5JbDX6JhuPt1QPB+OzjBz7wjvogsvMdUMoQtdHMxFIz+zxZK2C6del+6yn4 BiJhU/D2rk0rzseQ3xqQ+MjI49XXp/q9KDo6fVIFyJMxlsVtn48q7pDTt9/U9tVxP7U7 nWsXU8znH3ZxO0BAPVH5IhzcWdYZFzijCv7RkpsHHzSBGRnUj+9ZedHPee+xg7Gg9ZOu m8d/dRqBRVLyzh+HTOECu85GgDRSA4zhtXsm0oGbd24ebuRPBON3GsjWu6jWApifZMsp rAcg== MIME-Version: 1.0 Received: by 10.112.54.100 with SMTP id i4mr1681422lbp.97.1343410495624; Fri, 27 Jul 2012 10:34:55 -0700 (PDT) Received: by 10.152.114.70 with HTTP; Fri, 27 Jul 2012 10:34:55 -0700 (PDT) In-Reply-To: <501058B9.5050004@lsces.co.uk> References: <500EE3B9.8010902@ajf.me> <500EEA76.1030407@ajf.me> <5010138D.5050804@ajf.me> <501015B9.6050704@ajf.me> <501058B9.5050004@lsces.co.uk> Date: Fri, 27 Jul 2012 19:34:55 +0200 Message-ID: To: Lester Caine Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Re: Generators in PHP From: nikita.ppv@gmail.com (Nikita Popov) On Wed, Jul 25, 2012 at 10:36 PM, Lester Caine wrote: > But WHY would you not simply put the function that is handling the returned > data in place of the yield? > Why do you want to keep exiting and re-entering the 'do loop' when the data > can simply be forwarded direct to a function to handle it? This question has come up a few times now, i.e. why one can't just use callbacks. So I added a section about this, explaining it with a few examples: https://wiki.php.net/rfc/generators#why_not_just_use_callback_functions Hope it helps, Nikita