Statistical functions for PHP5