Re: 5.4 regression: non-existent sub-sub keys now have values
| From: | Stas Malyshev | Date: | Thu, 24 Nov 2011 01:38:35 +0000 |
| Subject: | Re: 5.4 regression: non-existent sub-sub keys now have values | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-56548@lists.php.net to get a copy of this message | ||
Hi!
But neither is introducing a potential bomb of the kind that the 'date' saga created. The problem this change IS causing is likely to hit many live sitesThe claim that many live sites actually regularly use string multiple string offsets to distinguish strings from arrays sounds implausible to me.
without any real explanation as to why it is happening. And I still don't think that the type of code that it is hitting is 'wrong', it IS just doing a lookupThere's real explanation and it's in UPGRADING now. And the code is not just plain "wrong" - it relies on a bug to distinguish between array and string, when it should use proper functions instead. If you want to check if something is an array, use is_array. Using side effect of a bug and claiming that the engine now should stay broken forever because you used it doesn't make any sense.
for an array element that does not exist to decide if it needs to create it.No, it's not going for array element - it applies multiple array operations to a string without checking and relies on a bug to pass it off. That's broken, plain and simple. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227