php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52534 var_export array with negative key
Submitted: 2010-08-04 18:31 UTC Modified: 2011-01-14 04:43 UTC
From: atila dot szekely at gmail dot com Assigned: felipe (profile)
Status: Closed Package: Strings related
PHP Version: 5.2.14 OS: Debian Lenny
Private report: No CVE-ID: None
 [2010-08-04 18:31 UTC] atila dot szekely at gmail dot com
Description:
------------
var_export is exporting negative array key as maxint (64 bit). Example: -1 will be replaced with 18446744073709551615 

Test script:
---------------
$aArray = array ( -1 => 'Hello', 1  => 'World');

$sExported = var_export($aArray,true);

echo $sExported;


Expected result:
----------------
array ( -1 => 'Hello',1 => 'World')

Actual result:
--------------
array ( 18446744073709551615 => 'Hello', 1 => 'World' ) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-05 01:11 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=301863
Log: - Fixed bug #52534 (var_export array with negative key)
 [2010-08-05 01:12 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-08-05 01:12 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in 5.3 branch and trunk.
 [2011-01-13 10:50 UTC] cvp at banglagamer dot com
Will this be fixed in any 5.2.x branch?
 [2011-01-14 04:43 UTC] aharvey@php.net
5.2 is no longer supported, so no.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 10:01:30 2024 UTC