Hi! On 11/23/11 12:56 AM, Lester Caine wrote:
I'm having a lot of trouble with working out WHAT is going on here at all.
It's actually very simple. Take variable $a which is a string ("foo"). Now it you do $a[0] that would produce first letter - "f". Now here's a tricky part - if you do $a['blah'] it would convert 'blah' to number, get 0 and return the same letter "f". Now what happens if you do $a[0][0]? Since $a[0] is "f", $a[0][0] should be first letter of "f" which is "f" again, right? Only in 5.3 it did not work because of some deficiencies in implementation of string offsets. In 5.4 it was fixed. Now the situation in the bug - what happens if we do $a['blah']['foobar']? As we noted before, it's the same as $a[0][0] and thus produces "f" in 5.4. In 5.3 it didn't work because of the above deficiency. That's it.
-- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php