|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70924 Return value description is incorrect
Submitted: 2015-11-16 17:30 UTC Modified: 2016-06-13 18:28 UTC
From: hunter at ellinger dot org Assigned:
Status: Open Package: stats (PECL)
PHP Version: Irrelevant OS:
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: hunter at ellinger dot org
New email:
PHP Version: OS:


 [2015-11-16 17:30 UTC] hunter at ellinger dot org
From manual page:
The return value described in the manual is that of a C routine that is used inside the C code that implements the PHP-callable STATS function.  Within that wrapper code, the desired numerical value is returned by reference, then picked up and made the return value of the PHP-callable function.  (In the case of a parameter-out-of-range error, FALSE is returned.)

For all STATS cdf functions, the desired value is specified by a $which parameter at the end of the parameter list.  A direct-cdf value (the cumulative probability $p corresponding to a position $x) is returned when the function is called with $x as the first parameter and a $which value of 1 as the last parameter.  An inverse-cdf value (the position $x corresponding to a cumulative probability $p) is returned when the function is called with $p as the first parameter and a $which value of 2 as the last parameter.  The second and third parameters of stats_cdf_beta are the distribution-defining $alpha and $beta parameters.  

The other stats_cdf_* functions use the same pattern, except that more or fewer distribution-defining parameters may be used depending on what is appropriate for that function.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-13 18:28 UTC]
-Package: Documentation problem +Package: stats
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 23 14:03:33 2021 UTC