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
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.
Password:
Status:
Package:
Bug Type:
Summary:
From: tkhan at beringmedia dot com
New email:
PHP Version: OS:

 

 [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: Thu Apr 25 03:01:29 2024 UTC