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