php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43725 Error in description of str_word_count
Submitted: 2008-01-02 03:47 UTC Modified: 2008-01-02 12:16 UTC
From: stanleyshapiro at yahoo dot ie Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: stanleyshapiro at yahoo dot ie
New email:
PHP Version: OS:

 

 [2008-01-02 03:47 UTC] stanleyshapiro at yahoo dot ie
Description:
------------
In the Description paragraph it states:
"If the optional format  is not specified, then the return value will be an integer representing the number of words found."   This is correct.

But in the 'format' parameter paragraph it states:

 Specify the return value of this function. The current supported values are:

    * 0 - returns the number of words found 
      ........

This is wrong.  The value 0 is invalid.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-02 12:16 UTC] felipe@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

<?php

$str = "Hello fri3nd, you're
       looking          good today!";

print_r(str_word_count($str, 0)); // 7

?>

Works fine.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 17 06:00:02 2026 UTC