|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-15 14:05 UTC] 2tl at mail dot ru
-Summary: Long int becomes negative, when using as array key
+Summary: Unsigned integer becomes signed and negative, when
using as an array key
[2010-07-15 14:05 UTC] 2tl at mail dot ru
[2010-11-30 14:25 UTC] iliaa@php.net
-Status: Open
+Status: Bogus
[2010-11-30 14:25 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 25 13:00:02 2025 UTC |
Description: ------------ There is a simple html form <input type="text" name="inventory[2391649236][product_code]" /> when post it, the $_REQUEST will be as below: Array ( [inventory] => Array ( [-1903318060] => Array ( [product_code] => ) ) ) Why 2391649236 become -1903318060? In my case, "2391649236" is just unique index. I got it with sprintf("%u", crc32($my_data)); Test script: --------------- <form> <input type="text" name="inventory[2391649236][product_code]" /> <input type="submit" /> </form> <?php print_r($_REQUEST) ?> Expected result: ---------------- Array ( [inventory] => Array ( [2391649236] => Array ( [product_code] => ) ) ) Actual result: -------------- Array ( [inventory] => Array ( [-1903318060] => Array ( [product_code] => ) ) )