Home » Math » Math_Stats » Bug #6252
Calculus of frequency give a E_NOTICE
Details
| Request #6252 | Calculus of frequency give a E_NOTICE |
|---|---|
| Submitted | 2005-12-15 17:50 UTC |
| From | Sebastien dot Boisvert at USherbrooke dot CA |
| Assigned | jmcastagnetto |
| Status | Closed |
| Package | Math_Stats |
| PHP Version | 4.4.0 |
| OS | linux 2.6.14.3 on Gentoo |
| Roadmaps | (Not assigned) |
Comments
[2005-12-15 17:50 UTC] Sebastien dot Boisvert at USherbrooke dot CA
Description:
------------
The E_NOTICE says that the code itself try to increment an element of an array, but this element has no value.
File : PEAR/Math/Stats.php
Version : Math_Stats-0.9.0beta3
Line : 1216
It does $freq["$val"]++;
I added the following just before :
if (!isset ($freq["$val"]))
{
$freq["$val"] = 0 ;
}
$ diff Stats.php Stats_modified.php
1215a1216,1218
> if (!isset ($freq["$val"])) {
> $freq["$val"] = 0 ;
> }