|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41009 new count() mode COUNT_RECURSIVE_VALUES
Submitted: 2007-04-05 22:07 UTC Modified: 2016-07-29 12:28 UTC
From: paulschreiber at gmail dot com Assigned:
Status: Open Package: Arrays related
PHP Version: 5.2.1 OS: n/a
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:
Bug Type:
From: paulschreiber at gmail dot com
New email:
PHP Version: OS:


 [2007-04-05 22:07 UTC] paulschreiber at gmail dot com
I would like a new count() mode flag, COUNT_RECURSIVE_VALUES, which 
counts the values and not the keys.

Reproduce code:
$b = array(0 => array(2,3), 1 => array(6,7));

// i see 2
print count($b);

// i see 6
print count($b, COUNT_RECURSIVE);

// i want to see "4"
print count($b, COUNT_RECURSIVE_VALUES);

Expected result:

Actual result:
// error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-29 12:28 UTC]
-Summary: ER: new count() mode COUNT_RECURSIVE_VALUES +Summary: new count() mode COUNT_RECURSIVE_VALUES -Package: Feature/Change Request +Package: Arrays related
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Jan 24 18:01:24 2020 UTC