src/Statistics.php
public static function frequency($values)
    {
        $frequency = [];
        foreach ($values as $value) {
            // Floats cannot be indices
            if (is_float($value)) {
                $value = strval($value);
            }

            if (!isset($frequency[$value])) {
                $frequency[$value] = 1;
            } else {
                $frequency[$value] += 1;
            }
        }

        asort($frequency);

        return $frequency;
    }
public static function frequency($values)
    {
        $frequency = [];
        foreach ($values as $value) {
            // Floats cannot be indices
            if (is_float($value)) {
                $value = strval($value);
            }

            if (!isset($frequency[$value])) {
                $frequency[$value] = 1;
            } else {
                $frequency[$value] += 1;
            }
        }

        asort($frequency);

        return $frequency;
    }
public static function frequency ( $ values ) { $ frequency = [ ] ; foreach ( $ values as $ value ) { // Floats cannot be indices if ( is_float ( $ value ) ) { $ value = strval ( $ value ) ; } if ( ! isset ( $ frequency [ $ value ] ) ) { $ frequency [ $ value ] = 1 ; } else { $ frequency [ $ value ] += 1 ; } } asort ( $ frequency ) ; return $ frequency ; }
Calculates the frequency table for a given set of values.

@param array $values The input values
@return array The frequency table
Calculates the frequency table for a given set of values .