Re: [PHP-DEV] Support for friend classes

2006-01-11 Thread Andi Gutmans
Yep, I agree with that. And coming from years of writing C++ I barely used friends and it always seemed kind of hackish to me. At 06:21 AM 1/11/2006, Ilia Alshanetsky wrote: I think we should avoid complicating an already complex OO functionality. Borrowing concepts from other languages is fine

Re: [PHP-DEV] Support for friend classes

2006-01-11 Thread Lukas Smith
Ilia Alshanetsky wrote: I think we should avoid complicating an already complex OO functionality. Borrowing concepts from other languages is fine, but to a degree. I think the PHP real world (not the guys porting Java APIs to PHP) requires support binary only: "public API" "my break at any ti

Re: [PHP-DEV] Support for friend classes

2006-01-11 Thread Ilia Alshanetsky
I think we should avoid complicating an already complex OO functionality. Borrowing concepts from other languages is fine, but to a degree. Ilia -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Support for friend classes

2006-01-11 Thread Sebastian Bergmann
Derick Rethans schrieb: > A second solution is: > http://derickrethans.nl/private_properties_exposed.php The mechanism above is emplyed by PHPUnit 3.0 to allow testing private and protected properties. -- Sebastian Bergmann http://www.sebastian-bergmann.de/ GnuPG Key: 0xB8

Re: [PHP-DEV] Support for friend classes

2006-01-11 Thread Hartmut Holzgraefe
Greg Beaver wrote: By definition, if you're accessing it from another class, then perhaps it isn't "private" at all. in C++ "friend" gives access to both "private" and "protected" ... This can be more easily and intuitively solved by using protected and CoderTest extends Coder, given that

Re: [PHP-DEV] Support for friend classes

2006-01-10 Thread Derick Rethans
On Wed, 11 Jan 2006, Leon Matthews wrote: > 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? If you only need friends for testing the contents of static properties, then there are alternative ways. On

Re: [PHP-DEV] Support for friend classes

2006-01-10 Thread Greg Beaver
Leon Matthews wrote: > 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