Doc #76031 [Com]: Several ext/stats functions are documented incorrectly
Edit report at https://bugs.php.net/bug.php?id=76031&edit=1
ID: 76031
Comment by: dmitriy dot shashkin at gmail dot com
Reported by: dustin dot glidden at gmail dot com
Summary: Several ext/stats functions are documented
incorrectly
Status: Verified
Type: Documentation Problem
Package: stats
Operating System: linux
PHP Version: 7.2.2
Block user comment: N
Private report: N
New Comment:
Same problem with function "stats_rand_gen_ibinomial" that was renamed to
"stats_rand_ibinomial".
Previous Comments:
------------------------------------------------------------------------
[2018-03-01 21:05:45] philip@php.net
It appears this was always the case, and that the prototype was wrong in the source code for the
stats_rand_ignlgi function for about 10 years.
The stats documentation was probably generated via a tool that read source prototypes (our tools
used to use prototypes long ago when generating doc skeletons, but now we have
doc-base/scripts/docgen/ uses Reflection data instead).
Here is the bug report that reported the incorrect prototype:
name mismatches in statistics.c (September 11, 2007)
https://bugs.php.net/bug.php?id=57832
And the patch that fixed this prototype and many others in the stats extension:
Fixed inconsistent prototype declarations (May 24, 2016)
https://github.com/php/pecl-math-stats/commit/900275fb3f84cca3dac574182e9f185602a42c53
While Bug #57832 requested stats_rand_ignlgi() be renamed to stats_rand_gen_int() to match the
prototype, that is not what happened, probably because the fix was ~8.5 years later and didn't
want to break backwards compatibility by renaming a bunch of functions.
Because commit 900275fb3f84cca3dac574182e9f185602a42c53 changed many prototypes, the odds are high
that many other stats functions are incorrectly documented and not only stats_rand_ignlgi(). For
this reason this bug report is being hijacked to compare and fix all stats functions here:
http://php.net/manual/en/ref.stats.php
There are several tools in doc-base/ that could help this cause, and if one does not exist for this
then it probably should. It might compare the source code, PHP documentation, and the extensions
Reflection data, and make sure all three are the same. Sorry for digressing but this was fun to
research :)
With all that said, if someone decides to only change stats_rand_gen_int() to stats_rand_ignlgi() in
the docs then that's okay, please report the fix here but leave the bug report open until all
of stats is evaluated.
------------------------------------------------------------------------
[2018-02-28 20:19:05] dustin dot glidden at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.stats-rand-gen-int
---
stats_rand_gen_int has changed to stats_rand_ignlgi
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76031&edit=1
Thread (4 messages)