Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62135 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60097 invoked from network); 14 Aug 2012 06:36:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2012 06:36:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.147 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.147 smtp147.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.147] ([67.192.241.147:46440] helo=smtp147.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CE/B1-00812-DE1F9205 for ; Tue, 14 Aug 2012 02:36:30 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp31.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 678DB50ADF; Tue, 14 Aug 2012 02:36:27 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp31.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 0B29350A9B; Tue, 14 Aug 2012 02:36:26 -0400 (EDT) Message-ID: <5029F1EA.5040507@sugarcrm.com> Date: Mon, 13 Aug 2012 23:36:26 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Anthony Ferrara CC: "internals@lists.php.net" References: <50298AC9.4070302@naderman.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Decorators Revisited From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > 2. Move instanceof to a handler from the current standalone function. Then > each (pecl level) class could choose its own implementation if it is > needed. The function could still exist for BC reasons, but would proxy to > the handler method if it existed... Then, the wrapped class (the additional > pointer) would only need to live on the objects internal store... I don't think overriding instanceof is a very good idea. instanceof has very defined meaning, which implies certain contract between classes and their clients, and allowing everybody to override it to mean whatever one likes looks very dangerous to me. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227