Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21469 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62521 invoked by uid 1010); 10 Jan 2006 23:15:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 62506 invoked from network); 10 Jan 2006 23:15:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2006 23:15:19 -0000 Received: from ([127.0.0.1:22628]) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with ECSTREAM id 3B/DC-27796-70044C34 for ; Tue, 10 Jan 2006 18:15:19 -0500 X-Host-Fingerprint: 203.109.254.60 grunt13.ihug.co.nz Linux 2.4/2.6 Received: from ([203.109.254.60:38589] helo=grunt13.ihug.co.nz) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id C7/CB-27796-28634C34 for ; Tue, 10 Jan 2006 17:34:43 -0500 Received: from 203-173-143-157.bliink.ihug.co.nz (dale) [203.173.143.157] by grunt13.ihug.co.nz with smtp (Exim 3.35 #1 (Debian)) id 1EwS4c-0002Fc-00; Wed, 11 Jan 2006 11:34:38 +1300 To: Date: Wed, 11 Jan 2006 11:37:05 +1300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Importance: Normal Subject: [PHP-DEV] Support for friend classes From: nzlug@lost.co.nz ("Leon Matthews") Hi. I'm responsible for writing unit tests for our PHP projects at work. I would find C++ style friend classes really useful for getting at another class's private methods. Since we adopted PHP5 we have been using lots of private methods to clean our interfaces up. Great news for everyone except me! I'd like to be able to do something like: class Coder { friend class CoderTest; private static function encode() { ... } } class CoderTest { $expected = ... $actual = Coder::encode(...); if( $expected != $actual ) ... } There is feature request on bugs.php.net (#34044) about this already, but no comments. Is there any support for this sort of thing out there? Useful addition to PHP6 maybe, or just another unnecessary feature? :-) Cheers, Leon