Reply to Re: Indexing non-arrays as arrays, no warnings?

Your name:

Reply:


Posted by ljb on 04/25/07 01:39

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.

[Back to original 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

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