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
I'd like to be able to do something like:
friend class CoderTest;
private static function encode()
$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? :-)