php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: paulschreiber at gmail dot com
New email:
PHP Version: OS:

 

 [2007-04-05 22:07 UTC] paulschreiber at gmail dot com
Description:
------------
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:
----------------
2
6
4

Actual result:
--------------
2
6
// error

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-29 12:28 UTC] cmb@php.net
-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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC