You are here: Re: Indexing non-arrays as arrays, no warnings? « PHP Programming Language « IT news, forums, messages
Re: Indexing non-arrays as arrays, no warnings?

Posted by gosha bine on 04/25/07 07:44

On 25.04.2007 03:39 ljb wrote:
> stereofrog@gmail.com wrote:
>> On 24.04.2007 02:49 ljb wrote:
>>> I was a bit surprised to find that indexing some non-arrays as if they were
>>> arrays does not even raise a Notice message. This works for NULL, integer,
>>> and floats at least. (PHP-5.2.1)
>>> ...
>>>
>>> I actually find this behavior useful, but I don't like depending on what
>>> seems to be a quirk.
>> this is the way it's coded in zend engine: reading indexed access to
>> scalars returns null. I agree that this behaviour is confusing, and it
>> doesn't seem to be documented. Did you consider filing a bug at php.net?
>
> What do you think, report it as a documentation bug (it works the way it
> should, but should be documented as such), or as an implementation bug (it
> should raise a notice or warning when you try to index NULL or a scalar)?
>
> Although I kind of like the way it works, I don't think it is right.

I'd file an implementation bug, it will be anyways reclassified as
"documentation problem" by zend devs. ;)

--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok

 

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

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