You are here: Re: How to do "friend class" in php? « PHP Programming Language « IT news, forums, messages
Re: How to do "friend class" in php?

Posted by Toby A Inkster on 07/18/07 12:14

Harrie Verveer wrote:

> Check out the discussion here: http://bugs.php.net/bug.php?id=34044

The comments on that page also include a rather nice way of implementing
friend classes yourself, though you may also want to overload __call().

Although a little more fiddly, the above method is arguably better than
C++'s. This is because with a little extra work you could define an
"acquaintance" class which is, say, the same as a friend class, but has
read-only access to object properties instead of read-write.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 27 days, 15:49.]

PHP Linkifier
http://tobyinkster.co.uk/blog/2007/07/18/linkify/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация