You are here: Re: objects of MyClass in array? « PHP Programming Language « IT news, forums, messages
Re: objects of MyClass in array?

Posted by Rik Wasmus on 01/08/08 00:10

On Tue, 08 Jan 2008 01:04:54 +0100, Steve <no.one@example.com> wrote:
> "Rik Wasmus" <luiheidsgoeroe@hotmail.com> wrote in message
> news:op.t4k2u0075bnjuv@metallium.lan...
>> On Tue, 08 Jan 2008 00:31:57 +0100, Steve <no.one@example.com> wrote:
>>> "devloop" <andrea2004@gmx.de> wrote in message
>>> news:a21e6087-932a-4683-95d0-3d1d65d7288e@s19g2000prg.googlegroups.com...
>>> Thank you soooo much! That´s it! I would have cost me years to find
>>> that as in JAVA you may write this or leave it!
>>>
>>> Do I have to add any include line to use iterator class or
>>> collections? Do they exist in php?
>>>
>>> ===========
>>>
>>> no.
>>
>> Yes, Iterators exist, as the are an interface for a class.
>
> should have been more specific. 'no' was to the first question..

Ah, your answer was confusing in that aspect indeed/

>>> there is very little strong typing in php
>>
>> Which has to do with?
>
> usually people customize a class to be enumerable is to get performance
> benefits in storing a specific type rather than a variant, default
> collection. that's what i meant. the second most common is functional
> clarity for the caller.
>
>>> and an array has the
>>> enumerable interface. anything you put in an array can be iterated with
>>> foreach
>>
>> Yes, however, creating an object as an ArrayObject/implementing
>> ArrayIterator, and private variables, will give you the possibility for
>> type hinting:
>
> true...but, i don't have that ide if 'intellisense' is what you mean. :)

Huh? ide? intellisense? I see no connection to an IDE, and intellisense
you'll have to explain to me.

> as for the code below, MyParticularObject can 'hint' a function param
> type
> anywhere...even a proc function. so, i'm not sure what you mean.

That was a response to your 'typing' remark, guessing at what you meant,
an illustration how you could force an array object to hold only one type
of data/class in it's 'collection'/array
--
Rik Wasmus

 

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

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