Hello Christian,

Tuesday, April 27, 2004, 1:34:47 PM, you wrote:

> Marcus Boerger wrote:
>>>[ $a = 'foo'; $a['bar'] = 42; has an even weirder behaviour: It results 
>>>in the string '4oo'... ]
>> 
>> That's a pretty. It is using 'bar' as a sting index to 'foo' and to do
>> this it needs to convert 'bar' to an integer. The rest is obvious.

> So you find it obvious that 42 is cast to string and the first character 
> is used as replacement? Wasn't obvious to me before I tried it :-)

That's what i meant it confuses far too many people and doesn't even make
real sense. For example converting 42 into chr(42) and setting it would
follow the same autoconversion logic. Hence a hint of kind E_STRICT would
be very good.

marcus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to