php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74828 count() return values: incorrect "not ... or not"
Submitted: 2017-06-29 09:34 UTC Modified: 2017-07-18 13:32 UTC
From: info at marcvangend dot nl Assigned: peehaa (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2017-06-29 09:34 UTC] info at marcvangend dot nl
Description:
------------
The documentation for count(), under Return Values, says: "If the parameter is not an array or not an object with implemented Countable interface, 1 will be returned." The "not ... or not" is logically incorrect; it it were correct, count() would always return 1 because an array is not an object with implemented Countable interface and vice versa.

I believe logically correct wordings would be (disclaimer, I'm not a native English speaker):
- If the parameter is not an array or an object with implemented Countable interface, 1 will be returned.
- If the parameter is not an array and not an object with implemented Countable interface, 1 will be returned.
- If the parameter is not an array nor an object with implemented Countable interface, 1 will be returned.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-30 11:03 UTC] cmb@php.net
I'm not a native speaker either, but I think it should be

  If the parameter is neither an array nor an object …
 [2017-07-01 13:00 UTC] peehaa@php.net
Works for me.

Might as well change if to when now we are nitpicking anyway :-)

When the parameter is neither an array nor an object …
 [2017-07-18 13:32 UTC] peehaa@php.net
Automatic comment from SVN on behalf of peehaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=342677
Log: Fixed wording of return value. Fixes #74828
 [2017-07-18 13:32 UTC] peehaa@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: peehaa
 [2017-07-18 13:32 UTC] peehaa@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 02:01:33 2024 UTC