Bugfix #21918

php.internals

(Marcus Börger)

23 years ago
Hello internals, according to our manual index values are either strings or integers. In case of strings which represent integers they are also handled as integers. Bug 21918 now shows that this currently only works for zero and positive index values. The attached patch would fix this.
-- Best regards, Marcus mailto:helly@php.net

(Marcus Börger)

23 years ago
Hello Marcus, Monday, August 11, 2003, 3:31:54 AM, you wrote: MB> Hello internals, MB> according to our manual index values are either strings or integers. In case MB> of strings which represent integers they are also handled as integers. Bug MB> 21918 now shows that this currently only works for zero and positive index MB> values. The attached patch would fix this. Ilia just reminded me of some update problems with negative index values. To fix those to i've put together another patch as attached. Now the following works, too: php -r ' $arr[-6] = "me"; $arr[] = "you"; var_dump($arr); ' array(2) { [-6]=> string(2) "me" [-5]=> string(3) "you" }
-- Best regards, Marcus mailto:helly@php.net

Ilia A.

23 years ago
+1 This patch not only fixes the above mentioned bugs, but also serveral backwards compatibility issues that occured due to the fix for bug #18140. Ilia

Jani Taskinen

23 years ago
+1 On Mon, 11 Aug 2003, Marcus Bö rger wrote:

Derick Rethans

23 years ago
On Mon, 11 Aug 2003, Marcus Börger wrote:
> Hello internals, > > according to our manual index values are either strings or integers. In case > of strings which represent integers they are also handled as integers. Bug > 21918 now shows that this currently only works for zero and positive index > values. The attached patch would fix this.
21:55 <@Derick> helly: I'm +1 too 21:55 <@helly> Derick: on the list please Derick
-- "Interpreting what the GPL actually means is a job best left to those that read the future by examining animal entrails." ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ International PHP Magazine http://php-mag.net/ -------------------------------------------------------------------------