|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78002 APCUIterator regexp array returns no results
Submitted: 2019-05-11 10:50 UTC Modified: 2021-07-16 14:53 UTC
From: ariartwt at gmail dot com Assigned: cmb (profile)
Status: Closed Package: APC (PECL)
PHP Version: 7.2.18 OS: Ubuntu 18.04.2
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 !
Your email address:
Solve the problem:
23 - 1 = ?
Subscribe to this entry?

 [2019-05-11 10:50 UTC] ariartwt at gmail dot com
From manual page:

Passing in an array of PCRE regular expressions to the constructor of APCUIterator as first argument never return any result.

Test script:


echo (new APCUIterator("/^Test$/"))->getTotalCount();// 1
echo (new APCUIterator(["Test"]))->getTotalCount();// 1
echo (new APCUIterator(["/^Test$/"]))->getTotalCount();// 0 -> should be 1

Expected result:
In my understanding of the documentation, we should be able to pass as first argument an array filled with regexp to find matching entries in apcu's stored keys.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-05-11 14:08 UTC]
From looking at the code, it appears that the array form expects
exactly matching strings, not regexps.
 [2019-05-11 14:26 UTC] ariartwt at gmail dot com
Thanks for your response.

If it's the intented behaviour, then it should be clarified in the doc, with an example, beacause the part about the array is pretty confusing to me for the $search argument description : "A PCRE regular expression that matches against APCu key names, either as a string for a single regular expression, or as an array of regular expressions."
 [2019-07-30 08:27 UTC] 511381703 at qq dot com
When I use new APCUIterator("/^prom:./")) init APCUIterator. I get an error 502, And my php version is 7.1.19 and APCU version is 5.1.17.
 [2021-07-16 14:53 UTC]
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem -Package: Unknown/Other Function +Package: APC -Assigned To: +Assigned To: cmb
 [2021-07-16 14:55 UTC]
Automatic comment on behalf of cmb69
Log: Fix #78002: APCUIterator regexp array returns no results
 [2021-07-16 14:55 UTC]
-Status: Verified +Status: Closed
 [2021-07-17 00:57 UTC]
Automatic comment on behalf of mumumu
Log: Fix #78002: APCUIterator regexp array returns no results
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Sep 22 09:03:38 2021 UTC