Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:38703 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96539 invoked from network); 2 Jul 2008 17:30:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jul 2008 17:30:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=stas@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=stas@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: stas@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:40259] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/B8-37564-32BBB684 for ; Wed, 02 Jul 2008 13:30:12 -0400 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 2 Jul 2008 20:30:28 +0300 Received: from [192.168.16.110] ([192.168.16.110]) by us-ex1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 2 Jul 2008 10:30:25 -0700 Message-ID: <486BBB1D.8050300@zend.com> Date: Wed, 02 Jul 2008 10:30:05 -0700 Organization: Zend Technologies User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Christian Seiler CC: php-dev List References: <486B6960.4030705@gmx.net> In-Reply-To: <486B6960.4030705@gmx.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Jul 2008 17:30:25.0080 (UTC) FILETIME=[4FEF0380:01C8DC69] Subject: Re: [PHP-DEV] [RFC] Closures: updated proposal and patch From: stas@zend.com (Stanislav Malyshev) Hi! Re-reading the proposal, I encountered something unexpected: $replacer = $example->getReplacer ('goodbye'); echo $replacer ('hello world'); // goodbye world $replacer->setSearch ('world'); echo $replacer ('hello world'); // hello goodbye Does it mean closure would forward all method calls to it to the enclosed object? Not sure if it's a good idea - seems too magical. Maybe we need to be more explicit, something like $replacer->getThis()->setSearch('world')? I.e., if you have object of type Closure, you can't actually know what methods it has - it'd depend on $this inside, which we don't have access to right now. That seems kind of strange. Or did you just mean $example->setSearch() and I'm worried about nothing? :) In this case, I'd just propose to have getThis() anyway. Except for that - excellent work! -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com