Re: Re: [PATCH] Bug #45877: LONG_MAX/MIN array key as string/int
| From: | Matt Wilmas | Date: | Thu, 19 Mar 2009 20:25:43 +0000 |
| Subject: | Re: Re: [PATCH] Bug #45877: LONG_MAX/MIN array key as string/int | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-43419@lists.php.net to get a copy of this message | ||
Hi Rasmus,
----- Original Message -----
From: "Rasmus Lerdorf"
Sent: Thursday, March 19, 2009
So, what is the final conclusion on this one? Are we at a combination of Matt's and Dmitry's patches here? I think we definitely need to fix this even in the 5.2 branch and get it back to 5.1.x and earlier behavior. I consider it a bug that: $arr[3500000000] = 'blah'; print_r($arr); results in: [-2147483648] => blah if someone has written brand new 5.2-specific code that relies on this weird behavior, then we will just have to bite the bullet and break that code. It is way more likely that people are relying on the earlier behavior and will end up with subtle problems in 5.2. I just had someone at Yahoo get bitten by this when they upgraded from 5.1.x to 5.2.x.This thread is about conversion of *numeric string* keys to int/long, rather than double conversion in your example. Bug #45877's behavior has been around forever I think until the fix a couple days ago (5.2 hasn't been changed). With the conversion behavior you're talking about, it sounds like you want the "double to long conversion change" thread. [1] :-) A change was made there over a year ago in 5.3+, and I've been wondering about what should be expected and how to make that expected behavior consistent across platforms. All details are in that message or the linked ones. However, nothing has been changed in a 5.2.x release (there was some partial backport shortly before getting reverted). If you noticed a change in 5.2.x, perhaps it was platform related? [1] http://marc.info/?l=php-internals&m=123704111325725&w=2
-Rasmus- Matt