You are here: RE: No more access to characters in strings in PHP 6 « PHP Programming Language « IT news, forums, messages
RE: No more access to characters in strings in PHP 6

Posted by Chung Leong on 11/27/05 01:35

> Interfaces are a kind of substitute for multiple inheritance.

Multiple inheritance is often used to implement interface in C++ true
enough. Interface in PHP would be a rather lousy subsitute for multiple
inheritance though, since you're basically inheriting classes that do
nothing.

Interface give you a quick way to check at run-time if an object has a
given set of methods. Other than that, I don't see much use for it.

The iterator example actually illustrates the problem with interface in
PHP: an object and its interfaces are one and the same. To loop through
a collection, the object has to remember the current index. Thus a
seemingly read-only operation ends up causing state changes. Unless
foreach() clone an object (which I don't it does), bad things would
happen when a second iteration is initiated before the first one
completes.

 

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

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