You are here: Re: php 5 classes: public, protected and private « PHP Programming Language « IT news, forums, messages
Re: php 5 classes: public, protected and private

Posted by Tony Marston on 12/02/06 12:05

"Michael Fesser" <netizen@gmx.de> wrote in message
news:u4f0n2tpfkfscou9beeq5pig121dhd9edf@4ax.com...
> .oO(Tony Marston)
>
>>> Just an example: Without
>>> these interfaces it wouldn't be possible to use 'foreach' to iterate
>>> over any arbitrary object:
>>>
>>> foreach ($directory as $file) {...}
>>> foreach ($resultSet as $record) {...}
>>
>>With PHP 5 it is possible to use 'foreach' on an object without the use of
>>interfaces, so your argument is not valid.
>
> It's a huge difference whether you just loop through all of the object's
> properties like an array (that's what you described above) or if each
> iteration automatically calls a particular method, which for example
> fetches the next record from a database.
>
> The latter is the basis of the SPL extension and not possible without
> interfaces. Maybe IYHO the entire extension is not valid as well?
>
> Micha

I have no opinion on the SPL extension as I have never used it. That
argument is irrelevant anyway. The point being debated here is whether
interfaces in PHP are necessary, and it is my opinion that they are NOT.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 

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

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