|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59633 APC does not auto convert keys that are string representations of numbers
Submitted: 2011-02-18 16:20 UTC Modified: 2016-11-18 21:46 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: tkhan at beringmedia dot com Assigned:
Status: Wont fix Package: APC (PECL)
PHP Version: 5.2.13 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: tkhan at beringmedia dot com
New email:
PHP Version: OS:


 [2011-02-18 16:20 UTC] tkhan at beringmedia dot com
When using array_fetch with an array of keys, if one of the keys is the string representation of a number then that key cannot be accessed in the returned array due to PHP's auto conversion of array keys that are string based representations of numbers to numbers. Reproduction of this issue does not require Apache or any other special configuration of PHP other then the installation and enabling of the APC extension.

Reproduce code:
apc_store ("123", "value1");
apc_store ("test", "value2");

$results = apc_fetch (array ("123","test"));

var_dump (isset($results["123"]));

Expected result:
That "bool(true)" is returned by the var_dump and that the element is accessible in the array via all array access methods supported by PHP.

Actual result:
The actual result is that "bool(false)" is returned by the var_dump and this element in the array cannot be accessed via the array subscript method.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-18 21:46 UTC]
-Status: Open +Status: Wont fix
 [2016-11-18 21:46 UTC]
APC is no longer supported in favor of opcache that comes bundled with PHP, if you wish to use the user cache, then look at PECL/APCu.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 21 22:01:34 2024 UTC