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
 [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

Pull Requests

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: Sat Dec 21 15:01:29 2024 UTC