#43949 [Opn->Bgs]: Incorrect index in arrays

From: Date: Sun, 27 Jan 2008 23:04:59 +0000
Subject: #43949 [Opn->Bgs]: Incorrect index in arrays
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121586@lists.php.net to get a copy of this message
ID: 43949 Updated by: felipe@php.net Reported By: fataluk1 at gmail dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Windows XP ( SP 2 ( not sure )) PHP Version: 5.2.5 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The large integer is converted to float at moment: echo($someNum."<br>"); And as array keys should be only integer or string, it isn't converted, then the large integer is converted to the integer limit. Previous Comments: ------------------------------------------------------------------------ [2008-01-27 22:47:44] fataluk1 at gmail dot com Description: ------------ Just see the code. Reproduce code: --------------- <?php $someNum=5776545345436; echo($someNum."<br>");//output the correct num $arr=Array($someNum=>'a'); $keys=array_keys($arr); echo($keys[0]); ?> Expected result: ---------------- 5776545345436 5776545345436 Actual result: -------------- 5776545345436 -185667684 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43949&edit=1

« previous php.bugs (#121586) next »