stmath php extension statistics math extension for php 8.1 Installation in Linux $ cd to /yourPhpVersion path $ git clone https://github.com/xmrrabbitx/stmath.git $ cd /stmath directory $ ../bin/phpize $ ./configure --with-php-config=$HOME/yourPhpVersion/bin/php-config $ make -j2 number of parallel jobs/processes to run $ make install $ add extension to php.ini: extenstion=stmath.so $ verify extension is loaded: ../bin/php -dextension=stmath -m | grep stmathsh Median Example <?php $median = stmathMedian([1,2,3,4]); var_dump($median); Result: float(2.5) Average Example $average = stmathAverage([2,2,3]); var_dump($average); Result: float(2.3333333333333335) Frequency Example $frequency = stmathFreq(5,[2,5,5,3,7,5]); var_dump($frequency); Result: int(3) Range Example $range = stmathRange([7,3,9,1,3]); var_dump($range); Result: int(8)