|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-02-28 20:19 UTC] 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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 03:00:02 2025 UTC |
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.