Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:42778 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69082 invoked from network); 22 Jan 2009 13:51:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jan 2009 13:51:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.163 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 212.25.124.163 il-gw1.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.163] ([212.25.124.163:19351] helo=il-gw1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E4/EA-15341-AD978794 for ; Thu, 22 Jan 2009 08:51:23 -0500 Received: from ws.home ([10.1.10.26]) by il-gw1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 22 Jan 2009 15:52:15 +0200 Message-ID: <497879CD.9020102@zend.com> Date: Thu, 22 Jan 2009 16:51:09 +0300 User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Marcus Boerger CC: Stanislav Malyshev , internals@lists.php.net References: <1016989528.20090112233204@marcus-boerger.de> <496BCD33.4080703@zend.com> <133861245.20090113225847@marcus-boerger.de> <496D2074.3070303@zend.com> <496DD269.4050701@gmail.com> <496E12CE.2080403@zend.com> <1956503865.20090117212630@marcus-boerger.de> <49743A89.3070607@zend.com> <995073772.20090119125721@marcus-boerger.de> In-Reply-To: <995073772.20090119125721@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 22 Jan 2009 13:52:15.0440 (UTC) FILETIME=[A22B7500:01C97C98] Subject: Re: [PHP-DEV] [RFC] prototyping From: dmitry@zend.com (Dmitry Stogov) Hi Marcus, I've just got an idea how prototyping may be implemented without magic you solution had. We can use a special function function attach_method($object, $name, $closure); This function should clone the $closure bind $this of clone of $closure to $object and assign it into $object->name (the original $closure should be unchanged). However it won't make possible to call it as $object->name() anyway. Also, it's a question what should attach_method() do if $closure already has $this (rebind it or throw an exception). Thanks. Dmitry.