Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:32538 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21405 invoked by uid 1010); 2 Oct 2007 09:41:18 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21390 invoked from network); 2 Oct 2007 09:41:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2007 09:41:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=php-php-dev@m.gmane.org; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=news@sea.gmane.org; sender-id=pass Received-SPF: pass (pb1.pair.com: domain m.gmane.org designates 80.91.229.2 as permitted sender) X-PHP-List-Original-Sender: php-php-dev@m.gmane.org X-Host-Fingerprint: 80.91.229.2 main.gmane.org Linux 2.5 (sometimes 2.4) (4) Received: from [80.91.229.2] ([80.91.229.2:57397] helo=ciao.gmane.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3D/AB-20520-B3212074 for ; Tue, 02 Oct 2007 05:41:16 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IceBT-0004IG-K2 for internals@lists.php.net; Tue, 02 Oct 2007 09:36:55 +0000 Received: from p5088be37.dip.t-dialin.net ([80.136.190.55]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Oct 2007 09:36:55 +0000 Received: from sb by p5088be37.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 02 Oct 2007 09:36:55 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Tue, 02 Oct 2007 11:32:53 +0200 Lines: 54 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: p5088be37.dip.t-dialin.net User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) Sender: news Subject: Class Posing From: sb@sebastian-bergmann.de (Sebastian Bergmann) From [1]: Objective-C permits a class to wholly replace another class within a program. The replacing class is said to "pose as" the target class. All messages sent to the target class are then instead received by the posing class. There are several restrictions on which classes can pose: * A class may only pose as one of its direct or indirect superclasses. [The other restrictions do not apply to PHP] Earlier this year, Johannes implemented class posing for PHP as follows: We (Johannes, Marcus, Sara, and myself) then discussed where to put this functionality. Outside of core, there were two places that both make sense: pecl/operator and pecl/runkit. However, to make this a viable mechanism that can be used in tools such as PHPUnit (for which I could really use this functionality), we agreed that it actually belongs into the core. Opinions? Needless to say that I would love to see this in PHP 5.3 ;-) -- [1] http://en.wikipedia.org/wiki/Objective_C#Posing -- Sebastian Bergmann http://sebastian-bergmann.de/ GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69