php.net |  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
Votes:1
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
25 + 7 = ?
Subscribe to this entry?

 
 [2011-02-18 16:20 UTC] tkhan at beringmedia dot com
Description:
------------
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:
---------------
<?php
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-18 21:46 UTC] kalle@php.net
-Status: Open +Status: Wont fix
 [2016-11-18 21:46 UTC] kalle@php.net
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: Tue Apr 23 10:01:29 2024 UTC