Doc #65567 [Opn->Fbk]: Documentation does not match thrown error
Edit report at https://bugs.php.net/bug.php?id=65567&edit=1
ID: 65567
Updated by: aharvey@php.net
Reported by: gavinromberger at yahoo dot com
Summary: Documentation does not match thrown error
-Status: Open
+Status: Feedback
Type: Documentation Problem
Package: APC
Operating System: Mac OSX 10.8
PHP Version: 5.5Git-2013-08-27 (Git)
Block user comment: N
Private report: N
New Comment:
Are you running APC or APCu? I can't see any way you'd get that error out of APC
proper, but it looks like APCu does change the parameters for
APCIterator::__construct() in some circumstances:
https://github.com/krakjoe/apcu/blob/simplify/apc_iterator.c#L321-L329
Previous Comments:
------------------------------------------------------------------------
[2013-08-27 23:16:55] gavinromberger at yahoo dot com
Description:
------------
when running this line of code
new APCIterator('user', '/^Attributes__/', APC_ITER_KEY);
I get this error -
Uncaught exception 'ErrorException' with message 'APCIterator::__construct()
expects parameter 2 to be long, string given'
This is what the documentation states concerning the constructor params -
public APCIterator::__construct ( string $cache [, mixed $search = null [, int
$format [, int $chunk_size = 100 [, int $list ]]]] )
Specifically for the $search param (param 2) the documentation states -
A PCRE regular expression that matches against APC key names, either as a string
for a single regular expression, or as an array of regular expressions. Or,
optionally pass in NULL to skip the search.
Test script:
---------------
new APCIterator('user', $search, APC_ITER_KEY);
Expected result:
----------------
I expect to get back an APCIterator object
Actual result:
--------------
fatal error
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65567&edit=1
Thread (4 messages)