php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65567 Documentation does not match thrown error
Submitted: 2013-08-27 23:16 UTC Modified: 2013-10-15 11:54 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: gavinromberger at yahoo dot com Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 5.5Git-2013-08-27 (Git) OS: Mac OSX 10.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gavinromberger at yahoo dot com
New email:
PHP Version: OS:

 

 [2013-08-27 23:16 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-11 21:45 UTC] aharvey@php.net
-Status: Open +Status: Feedback
 [2013-09-11 21:45 UTC] aharvey@php.net
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
 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2014-02-27 09:19 UTC] blizzz at owncloud dot com
I see the same error message, running APCu.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 14:03:20 2021 UTC