diff options
| -rw-r--r-- | php-pecl-stats.spec | 50 | ||||
| -rw-r--r-- | stats-php8.patch | 2215 | 
2 files changed, 2234 insertions, 31 deletions
diff --git a/php-pecl-stats.spec b/php-pecl-stats.spec index bbd5b69..739ce3a 100644 --- a/php-pecl-stats.spec +++ b/php-pecl-stats.spec @@ -1,6 +1,6 @@  # spec file for php-pecl-stats  # -# Copyright (c) 2013-2019 Remi Collet +# Copyright (c) 2013-2021 Remi Collet  # License: CC-BY-SA  # http://creativecommons.org/licenses/by-sa/4.0/  # @@ -19,13 +19,18 @@  Summary:        Routines for statistical computation  Name:           %{?scl_prefix}php-pecl-%{pecl_name}  Version:        2.0.3 -Release:        8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release:        9%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}  License:        PHP -URL:            http://pecl.php.net/package/%{pecl_name} -Source0:        http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +URL:            https://pecl.php.net/package/%{pecl_name} +Source0:        https://pecl.php.net/get/%{pecl_name}-%{version}.tgz +# Upstream patch for PHP 8 +# Mostly output of: git diff 2.0.3 -- *.c *.h tests/ +Patch0:         %{pecl_name}-php8.patch + +BuildRequires:  make  BuildRequires:  %{?dtsprefix}gcc -BuildRequires:  %{?scl_prefix}php-devel > 7 +BuildRequires:  %{?scl_prefix}php-devel >= 7  BuildRequires:  %{?scl_prefix}php-pear  Requires:       %{?scl_prefix}php(zend-abi) = %{php_zend_api} @@ -41,40 +46,17 @@ Provides:       %{?scl_prefix}php-pecl-%{pecl_name}          = %{version}-%{rele  Provides:       %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa}  = %{version}-%{release}  %endif -%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} +%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}  # Other third party repo stuff -Obsoletes:     php53-pecl-%{pecl_name}  <= %{version} -Obsoletes:     php53u-pecl-%{pecl_name} <= %{version} -Obsoletes:     php54-pecl-%{pecl_name}  <= %{version} -Obsoletes:     php54w-pecl-%{pecl_name} <= %{version} -Obsoletes:     php55u-pecl-%{pecl_name} <= %{version} -Obsoletes:     php55w-pecl-%{pecl_name} <= %{version} -Obsoletes:     php56u-pecl-%{pecl_name} <= %{version} -Obsoletes:     php56w-pecl-%{pecl_name} <= %{version} -Obsoletes:     php70u-pecl-%{pecl_name} <= %{version} -Obsoletes:     php70w-pecl-%{pecl_name} <= %{version} -%if "%{php_version}" > "7.1" -Obsoletes:     php71u-pecl-%{pecl_name} <= %{version} -Obsoletes:     php71w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.2" -Obsoletes:     php72u-pecl-%{pecl_name} <= %{version} -Obsoletes:     php72w-pecl-%{pecl_name} <= %{version} -%endif  %if "%{php_version}" > "7.3"  Obsoletes:      php73-pecl-%{pecl_name} <= %{version} -Obsoletes:     php73w-pecl-%{pecl_name} <= %{version}  %endif  %if "%{php_version}" > "7.4"  Obsoletes:      php74-pecl-%{pecl_name} <= %{version} -Obsoletes:     php74w-pecl-%{pecl_name} <= %{version}  %endif +%if "%{php_version}" > "8.0" +Obsoletes:      php80-pecl-%{pecl_name} <= %{version}  %endif - -%if 0%{?fedora} < 20 && 0%{?rhel} < 7 -# Filter private shared object -%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} -%{?filter_setup}  %endif @@ -94,6 +76,9 @@ sed -e 's/role="test"/role="src"/' \      -i package.xml  cd NTS +%if "%{php_version}" > "8.0" +%patch0 -p1 -b .upstream +%endif  # Sanity check, really often broken  extver=$(sed -n '/#define PHP_STATS_VERSION/{s/.* "//;s/".*$//;p}' php_stats.h) @@ -226,6 +211,9 @@ REPORT_EXIT_STATUS=1 \  %changelog +* Mon Apr 19 2021 Remi Collet <remi@remirepo.net> - 2.0.3-9 +- add upstream patch for PHP 8 +  * Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 2.0.3-8  - rebuild for 7.4.0RC1 diff --git a/stats-php8.patch b/stats-php8.patch new file mode 100644 index 0000000..dabfa3f --- /dev/null +++ b/stats-php8.patch @@ -0,0 +1,2215 @@ +diff --git a/php_stats.c b/php_stats.c +index 32dc4e9..7418dd8 100644 +--- a/php_stats.c ++++ b/php_stats.c +@@ -16,27 +16,52 @@ +   +----------------------------------------------------------------------+ + */ +  +-/* $Id$ */ +- +- + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif +  + #include "php.h" +-#include "php_stats.h" + #include "ext/standard/info.h" + #include "ext/standard/head.h" ++#include "php_stats.h" ++#include "randlib.h" ++#include "cdflib.h" ++ ++#ifndef ZEND_ARG_INFO_WITH_DEFAULT_VALUE ++#define ZEND_ARG_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, default_value) \ ++    ZEND_ARG_INFO(pass_by_ref, name) ++#endif ++ ++#if PHP_VERSION_ID < 70200 ++#undef ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX ++#define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ ++    static const zend_internal_arg_info name[] = { \ ++        { (const char*)(zend_uintptr_t)(required_num_args), ( #class_name ), 0, return_reference, allow_null, 0 }, ++#endif ++ ++#ifndef ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX ++#define ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) \ ++    ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, class_name, allow_null) ++#endif ++ ++#ifndef ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX ++# define ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(name, return_reference, num_args, type) \ ++    ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, num_args) ++#endif ++ ++#ifndef ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE ++#define ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(pass_by_ref, name, type_hint, allow_null, default_value) \ ++    ZEND_ARG_TYPE_INFO(pass_by_ref, name, type_hint, allow_null) ++#endif ++ ++#include "stats_arginfo.h" + #include <stdlib.h> + #include <string.h> + #include <ctype.h> + #include <math.h> +-#include "randlib.h" +-#include "cdflib.h" +  + #define STATS_PI 3.14159265358979323846 +  +- + #ifdef PHP_WIN32 + extern double fd_lgamma(double x); + #define lgamma fd_lgamma +@@ -52,89 +77,16 @@ static double exponential_quantile(double p); + static double exponential_cdf(double x); + static double binom(double x, double n); +  +-zend_function_entry statistics_functions[] = { +-	PHP_FE(stats_cdf_t,					NULL) +-	PHP_FE(stats_cdf_normal,			NULL) +-	PHP_FE(stats_cdf_gamma,				NULL) +-	PHP_FE(stats_cdf_chisquare,			NULL) +-	PHP_FE(stats_cdf_beta,				NULL) +-	PHP_FE(stats_cdf_binomial,			NULL) +-	PHP_FE(stats_cdf_noncentral_chisquare,NULL) +-	PHP_FE(stats_cdf_f,					NULL) +-	PHP_FE(stats_cdf_noncentral_f,		NULL) +-	PHP_FE(stats_cdf_noncentral_t,		NULL) +-	PHP_FE(stats_cdf_negative_binomial,	NULL) +-	PHP_FE(stats_cdf_poisson,			NULL) +-	PHP_FE(stats_cdf_laplace,			NULL) +-	PHP_FE(stats_cdf_cauchy,			NULL) +-	PHP_FE(stats_cdf_logistic,			NULL) +-	PHP_FE(stats_cdf_weibull,			NULL) +-	PHP_FE(stats_cdf_uniform,			NULL) +-	PHP_FE(stats_cdf_exponential,		NULL) +-	PHP_FE(stats_rand_setall,			NULL) +-	PHP_FE(stats_rand_getsd,			NULL) +-	PHP_FE(stats_rand_gen_iuniform,		NULL) +-	PHP_FE(stats_rand_gen_funiform,		NULL) +-	PHP_FE(stats_rand_ignlgi,			NULL) +-	PHP_FE(stats_rand_ranf,				NULL) +-	PHP_FE(stats_rand_gen_beta,			NULL) +-	PHP_FE(stats_rand_gen_chisquare,	NULL) +-	PHP_FE(stats_rand_gen_exponential,	NULL) +-	PHP_FE(stats_rand_gen_f,			NULL) +-	PHP_FE(stats_rand_gen_gamma,		NULL) +-	PHP_FE(stats_rand_gen_noncentral_chisquare,NULL) +-	PHP_FE(stats_rand_gen_noncenral_f,	NULL) +-	PHP_FE(stats_rand_gen_normal,		NULL) +-	PHP_FE(stats_rand_phrase_to_seeds,	NULL) +-	PHP_FE(stats_rand_ibinomial,		NULL) +-	PHP_FE(stats_rand_ibinomial_negative,NULL) +-	PHP_FE(stats_rand_gen_ipoisson,		NULL) +-	PHP_FE(stats_rand_gen_noncentral_t,	NULL) +-	PHP_FE(stats_rand_gen_t,			NULL) +-	PHP_FE(stats_dens_normal,			NULL) +-	PHP_FE(stats_dens_cauchy,			NULL) +-	PHP_FE(stats_dens_laplace,			NULL) +-	PHP_FE(stats_dens_logistic,			NULL) +-	PHP_FE(stats_dens_beta,				NULL) +-	PHP_FE(stats_dens_weibull,			NULL) +-	PHP_FE(stats_dens_uniform,			NULL) +-	PHP_FE(stats_dens_chisquare,		NULL) +-	PHP_FE(stats_dens_t,				NULL) +-	PHP_FE(stats_dens_gamma,			NULL) +-	PHP_FE(stats_dens_exponential,		NULL) +-	PHP_FE(stats_dens_f,				NULL) +-	PHP_FE(stats_dens_pmf_binomial,		NULL) +-	PHP_FE(stats_dens_pmf_poisson,		NULL) +-	PHP_FE(stats_dens_pmf_negative_binomial,NULL) +-	PHP_FE(stats_dens_pmf_hypergeometric,	NULL) +-	PHP_FE(stats_stat_powersum,			NULL) +-	PHP_FE(stats_stat_innerproduct,		NULL) +-	PHP_FE(stats_stat_independent_t,	NULL) +-	PHP_FE(stats_stat_paired_t,			NULL) +-	PHP_FE(stats_stat_percentile,		NULL) +-	PHP_FE(stats_stat_correlation,		NULL) +-	PHP_FE(stats_stat_binomial_coef,	NULL) +-	PHP_FE(stats_stat_factorial,		NULL) +-	PHP_FE(stats_variance,				NULL) +-	PHP_FE(stats_standard_deviation,	NULL) +-	PHP_FE(stats_absolute_deviation,	NULL) +-	PHP_FE(stats_harmonic_mean,			NULL) +-	PHP_FE(stats_skew,					NULL) +-	PHP_FE(stats_kurtosis,				NULL) +-	PHP_FE(stats_covariance,			NULL) +-	{NULL, NULL, NULL} +-}; +- + zend_module_entry stats_module_entry = { + 	STANDARD_MODULE_HEADER, + 	"stats", +-	statistics_functions, +- 	NULL, +- 	NULL, +- 	NULL, +- 	NULL, +- 	PHP_MINFO(stats), +- 	PHP_STATS_VERSION, ++	ext_functions, ++	NULL, ++	NULL, ++	NULL, ++	NULL, ++	PHP_MINFO(stats), ++	PHP_STATS_VERSION, + 	STANDARD_MODULE_PROPERTIES, + }; +  +@@ -159,7 +111,7 @@ PHP_MINFO_FUNCTION(stats) +  * +  * This is not correct any more, depends on what compare_func is set to. +  */ +-static int stats_array_data_compare(const void *a, const void *b TSRMLS_DC) ++static int stats_array_data_compare(const void *a, const void *b) + { + 	Bucket *f; + 	Bucket *s; +@@ -173,7 +125,7 @@ static int stats_array_data_compare(const void *a, const void *b TSRMLS_DC) + 	first = f->val; + 	second = s->val; +  +-	result = numeric_compare_function(&first, &second TSRMLS_CC); ++	result = numeric_compare_function(&first, &second); +  + 	if (result < 0) { + 		return -1; +@@ -267,12 +219,12 @@ PHP_FUNCTION(stats_cdf_t) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddl", &arg1, &arg2, &which) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ddl", &arg1, &arg2, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 3) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third parameter should be in the 1..3 range"); ++		php_error_docref(NULL, E_WARNING, "Third parameter should be in the 1..3 range"); + 		RETURN_FALSE; + 	} +  +@@ -291,7 +243,7 @@ PHP_FUNCTION(stats_cdf_t) + 	cdft((int *)&which, &p, &q, &t, &df, &status, &bound); +  + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error"); ++		php_error_docref(NULL, E_WARNING, "Computation Error"); + 		RETURN_FALSE; + 	} +  +@@ -397,12 +349,12 @@ PHP_FUNCTION(stats_cdf_normal) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -427,15 +379,15 @@ PHP_FUNCTION(stats_cdf_normal) +  + 	cdfnor((int *)&which, &p, &q, &x, &mean, &sd, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation error"); ++		php_error_docref(NULL, E_WARNING, "Computation error"); + 		RETURN_FALSE; + 	} +  + 	switch (which) { +-	  	case 1: RETURN_DOUBLE(p); +-	  	case 2: RETURN_DOUBLE(x); +-	  	case 3: RETURN_DOUBLE(mean); +-	  	case 4: RETURN_DOUBLE(sd); ++		case 1: RETURN_DOUBLE(p); ++		case 2: RETURN_DOUBLE(x); ++		case 3: RETURN_DOUBLE(mean); ++		case 4: RETURN_DOUBLE(sd); + 	} + 	RETURN_FALSE; /* should never be reached */ + } +@@ -544,13 +496,13 @@ PHP_FUNCTION(stats_cdf_gamma) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -583,15 +535,15 @@ PHP_FUNCTION(stats_cdf_gamma) +  + 	cdfgam((int *)&which, &p, &q, &x, &shape, &rate, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error"); ++		php_error_docref(NULL, E_WARNING, "Computation Error"); + 		RETURN_FALSE; + 	} +  + 	switch (which)	{ +-	  	case 1: RETURN_DOUBLE(p); +-	  	case 2: RETURN_DOUBLE(x); +-	  	case 3: RETURN_DOUBLE(shape); +-	  	case 4: RETURN_DOUBLE(1 / rate); ++		case 1: RETURN_DOUBLE(p); ++		case 2: RETURN_DOUBLE(x); ++		case 3: RETURN_DOUBLE(shape); ++		case 4: RETURN_DOUBLE(1 / rate); + 	} + 	RETURN_FALSE; /* should never be reached */ + } +@@ -679,13 +631,13 @@ PHP_FUNCTION(stats_cdf_chisquare) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddl", &arg1, &arg2, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 3) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third parameter should be in the 1..3 range"); ++		php_error_docref(NULL, E_WARNING, "Third parameter should be in the 1..3 range"); + 		RETURN_FALSE; + 	} +  +@@ -702,9 +654,9 @@ PHP_FUNCTION(stats_cdf_chisquare) + 		q = 1.0 - p; + 	} +  +- 	cdfchi((int *)&which, &p, &q, &x, &df, &status, &bound); ++	cdfchi((int *)&which, &p, &q, &x, &df, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error"); ++		php_error_docref(NULL, E_WARNING, "Computation Error"); + 		RETURN_FALSE; + 	} +  +@@ -816,13 +768,13 @@ PHP_FUNCTION(stats_cdf_beta) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -850,15 +802,15 @@ PHP_FUNCTION(stats_cdf_beta) +  + 	cdfbet((int *)&which, &p, &q, &x, &y, &a, &b, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error"); ++		php_error_docref(NULL, E_WARNING, "Computation Error"); + 		RETURN_FALSE; + 	} +  + 	switch (which) { +-	  	case 1: RETURN_DOUBLE(p); +-	  	case 2: RETURN_DOUBLE(x); +-	  	case 3: RETURN_DOUBLE(a); +-	  	case 4: RETURN_DOUBLE(b); ++		case 1: RETURN_DOUBLE(p); ++		case 2: RETURN_DOUBLE(x); ++		case 3: RETURN_DOUBLE(a); ++		case 4: RETURN_DOUBLE(b); + 	} + 	RETURN_FALSE; /* never here */ + } +@@ -956,13 +908,13 @@ PHP_FUNCTION(stats_cdf_binomial) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -989,15 +941,15 @@ PHP_FUNCTION(stats_cdf_binomial) +  + 	cdfbin((int *)&which, &p, &q, &sn, &xn, &pr, &ompr, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error in binomialcdf"); ++		php_error_docref(NULL, E_WARNING, "Computation Error in binomialcdf"); + 		RETURN_FALSE; + 	} +  + 	switch (which) { +-	  	case 1: RETURN_DOUBLE(p); +-	  	case 2: RETURN_DOUBLE(sn); +-	  	case 3: RETURN_DOUBLE(xn); +-	  	case 4: RETURN_DOUBLE(pr); ++		case 1: RETURN_DOUBLE(p); ++		case 2: RETURN_DOUBLE(sn); ++		case 3: RETURN_DOUBLE(xn); ++		case 4: RETURN_DOUBLE(pr); + 	} + 	RETURN_FALSE; /* never here */ + } +@@ -1096,13 +1048,13 @@ PHP_FUNCTION(stats_cdf_noncentral_chisquare) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -1127,15 +1079,15 @@ PHP_FUNCTION(stats_cdf_noncentral_chisquare) +  + 	cdfchn((int *)&which, &p, &q, &x, &df, &pnonc, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error in cdfchn"); ++		php_error_docref(NULL, E_WARNING, "Computation Error in cdfchn"); + 		RETURN_FALSE; + 	} +  + 	switch (which) { +-	  	case 1: RETURN_DOUBLE(p); +-	  	case 2: RETURN_DOUBLE(x); +-	  	case 3: RETURN_DOUBLE(df); +-	  	case 4: RETURN_DOUBLE(pnonc); ++		case 1: RETURN_DOUBLE(p); ++		case 2: RETURN_DOUBLE(x); ++		case 3: RETURN_DOUBLE(df); ++		case 4: RETURN_DOUBLE(pnonc); + 	} + 	RETURN_FALSE; /* never here */ + } +@@ -1230,13 +1182,13 @@ PHP_FUNCTION(stats_cdf_f) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} + 	if (which < 4) { +@@ -1258,15 +1210,15 @@ PHP_FUNCTION(stats_cdf_f) +  + 	cdff((int *)&which, &p, &q, &f, &dfn, &dfd, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error in cdff"); ++		php_error_docref(NULL, E_WARNING, "Computation Error in cdff"); + 		RETURN_FALSE; + 	} +  + 	switch (which) { +-	  	case 1: RETURN_DOUBLE(p); +-	  	case 2: RETURN_DOUBLE(f); +-	  	case 3: RETURN_DOUBLE(dfn); +-	  	case 4: RETURN_DOUBLE(dfd); ++		case 1: RETURN_DOUBLE(p); ++		case 2: RETURN_DOUBLE(f); ++		case 3: RETURN_DOUBLE(dfn); ++		case 4: RETURN_DOUBLE(dfd); + 	} + 	RETURN_FALSE; /* never here */ + } +@@ -1378,13 +1330,13 @@ PHP_FUNCTION(stats_cdf_noncentral_f) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddddl", &arg1, &arg2, &arg3, &arg4, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 5) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fifth parameter should be in the 1..5 range"); ++		php_error_docref(NULL, E_WARNING, "Fifth parameter should be in the 1..5 range"); + 		RETURN_FALSE; + 	} +  +@@ -1415,15 +1367,15 @@ PHP_FUNCTION(stats_cdf_noncentral_f) +  + 	cdffnc((int *)&which, &p, &q, &f, &dfn, &dfd, &pnonc, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error in cdffnc"); ++		php_error_docref(NULL, E_WARNING, "Computation Error in cdffnc"); + 		RETURN_FALSE; + 	} +  + 	switch (which) { +-	  	case 1: RETURN_DOUBLE(p); +-	  	case 2: RETURN_DOUBLE(f); +-	  	case 3: RETURN_DOUBLE(dfn); +-	  	case 4: RETURN_DOUBLE(dfd); ++		case 1: RETURN_DOUBLE(p); ++		case 2: RETURN_DOUBLE(f); ++		case 3: RETURN_DOUBLE(dfn); ++		case 4: RETURN_DOUBLE(dfd); + 		case 5: RETURN_DOUBLE(pnonc); + 	} + 	RETURN_FALSE; /* never here */ +@@ -1512,13 +1464,13 @@ PHP_FUNCTION(stats_cdf_noncentral_t) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -1542,7 +1494,7 @@ PHP_FUNCTION(stats_cdf_noncentral_t) +  + 	cdftnc((int *)&which, &p, &q, &t, &df, &pnonc, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error"); ++		php_error_docref(NULL, E_WARNING, "Computation Error"); + 		RETURN_FALSE; + 	} +  +@@ -1657,13 +1609,13 @@ PHP_FUNCTION(stats_cdf_negative_binomial) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -1689,7 +1641,7 @@ PHP_FUNCTION(stats_cdf_negative_binomial) +  + 	cdfnbn((int *)&which, &p, &q, &sn, &xn, &pr, &ompr, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error in cdfnbn"); ++		php_error_docref(NULL, E_WARNING, "Computation Error in cdfnbn"); + 		RETURN_FALSE; + 	} +  +@@ -1780,13 +1732,13 @@ PHP_FUNCTION(stats_cdf_poisson) + 	zend_long which; + 	int status = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddl", &arg1, &arg2, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 3) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third parameter should be in the 1..3 range"); ++		php_error_docref(NULL, E_WARNING, "Third parameter should be in the 1..3 range"); + 		RETURN_FALSE; + 	} +  +@@ -1805,7 +1757,7 @@ PHP_FUNCTION(stats_cdf_poisson) +  + 	cdfpoi((int *)&which, &p, &q, &x, &xlam, &status, &bound); + 	if (status != 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Computation Error"); ++		php_error_docref(NULL, E_WARNING, "Computation Error"); + 		RETURN_FALSE; + 	} +  +@@ -1839,7 +1791,7 @@ static double laplace_cdf(double x) +  +  + /* {{{ proto float stats_cdf_laplace(float par1, float par2, float par3, int which) +-    Calculates any one parameter of the Laplace distribution given values for the others. */ ++	Calculates any one parameter of the Laplace distribution given values for the others. */ + PHP_FUNCTION(stats_cdf_laplace) + { + 	double arg1; +@@ -1852,13 +1804,13 @@ PHP_FUNCTION(stats_cdf_laplace) + 	double sd; + 	zend_long which; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -1909,7 +1861,7 @@ static double cauchy_cdf (double x) + } +  + /* {{{ proto float stats_cdf_cauchy(float par1, float par2, float par3, int which) +-    Calculates any one parameter of the Cauchy distribution given values for the others. */ ++	Calculates any one parameter of the Cauchy distribution given values for the others. */ + PHP_FUNCTION(stats_cdf_cauchy) + { + 	double arg1; +@@ -1922,13 +1874,13 @@ PHP_FUNCTION(stats_cdf_cauchy) + 	double sd; + 	zend_long which; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -1978,7 +1930,7 @@ static double logistic_quantile (double p) + } +  + /* {{{ proto float stats_cdf_logistic(float par1, float par2, float par3, int which) +-    Calculates any one parameter of the logistic distribution given values for the others. */ ++	Calculates any one parameter of the logistic distribution given values for the others. */ + PHP_FUNCTION(stats_cdf_logistic) + { + 	double arg1; +@@ -1991,13 +1943,13 @@ PHP_FUNCTION(stats_cdf_logistic) + 	double mean; + 	zend_long which; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -2037,7 +1989,7 @@ PHP_FUNCTION(stats_cdf_logistic) + /* }}} */ +  + /* {{{ proto float stats_cdf_weibull(float par1, float par2, float par3, int which) +-    Calculates any one parameter of the Weibull distribution given values for the others. */ ++	Calculates any one parameter of the Weibull distribution given values for the others. */ + PHP_FUNCTION(stats_cdf_weibull) + { + 	double arg1; +@@ -2049,13 +2001,13 @@ PHP_FUNCTION(stats_cdf_weibull) + 	double b; + 	zend_long which; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -2087,7 +2039,7 @@ PHP_FUNCTION(stats_cdf_weibull) + /* }}} */ +  + /* {{{ proto float stats_cdf_uniform(float par1, float par2, float par3, int which) +-    Calculates any one parameter of the uniform distribution given values for the others. */ ++	Calculates any one parameter of the uniform distribution given values for the others. */ + PHP_FUNCTION(stats_cdf_uniform) + { + 	double arg1; +@@ -2099,13 +2051,13 @@ PHP_FUNCTION(stats_cdf_uniform) + 	double b; + 	zend_long which; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dddl", &arg1, &arg2, &arg3, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 4) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth parameter should be in the 1..4 range"); ++		php_error_docref(NULL, E_WARNING, "Fourth parameter should be in the 1..4 range"); + 		RETURN_FALSE; + 	} +  +@@ -2128,7 +2080,7 @@ PHP_FUNCTION(stats_cdf_uniform) + 	} +  + 	if (which > 1 && (p < 0.0F || p > 1.0F)) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "p is out of range. p : %16.6E", p); ++		php_error_docref(NULL, E_WARNING, "p is out of range. p : %16.6E", p); + 		RETURN_FALSE; + 	} +  +@@ -2163,7 +2115,7 @@ static double exponential_cdf(double x) + } +  + /* {{{ proto float stats_cdf_exponential(float par1, float par2, int which) +-    Calculates any one parameter of the exponential distribution given values for the others. */ ++	Calculates any one parameter of the exponential distribution given values for the others. */ + PHP_FUNCTION(stats_cdf_exponential) + { + 	double arg1; +@@ -2173,13 +2125,13 @@ PHP_FUNCTION(stats_cdf_exponential) + 	double scale; + 	zend_long which; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddl", &arg1, &arg2, &which) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (which < 1 || which > 3) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third parameter should be in the 1..3 range"); ++		php_error_docref(NULL, E_WARNING, "Third parameter should be in the 1..3 range"); + 		RETURN_FALSE; + 	} +  +@@ -2209,18 +2161,19 @@ PHP_FUNCTION(stats_cdf_exponential) + /* RANDLIB functions */ + /*********************/ +  +-/* {{{ proto void stats_rand_setall(int iseed1, int iseed2) ++/* {{{ proto bool stats_rand_setall(int iseed1, int iseed2) + 	Not documented */ + PHP_FUNCTION(stats_rand_setall) + { + 	zend_long iseed_1; + 	zend_long iseed_2; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &iseed_1, &iseed_2) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &iseed_1, &iseed_2) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	setall(iseed_1, iseed_2); ++    RETURN_TRUE; + } + /* }}} */ +  +@@ -2243,22 +2196,22 @@ PHP_FUNCTION(stats_rand_getsd) + /* }}} */ +  + /* {{{ proto int stats_rand_gen_iuniform(int low, int high) +-   Generates integer uniformly distributed between LOW (inclusive) and HIGH (inclusive)  */ ++	Generates integer uniformly distributed between LOW (inclusive) and HIGH (inclusive)  */ + PHP_FUNCTION(stats_rand_gen_iuniform) + { + 	zend_long low; + 	zend_long high; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &low, &high) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &low, &high) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (high - low > 2147483561L) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "high - low too large. low : %16ld  high %16ld", low, high); ++		php_error_docref(NULL, E_WARNING, "high - low too large. low : %16ld  high %16ld", low, high); + 		RETURN_FALSE; + 	} + 	if (low > high) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "low greater than high. low : %16ld  high %16ld", low, high); ++		php_error_docref(NULL, E_WARNING, "low greater than high. low : %16ld  high %16ld", low, high); + 		RETURN_FALSE; + 	} +  +@@ -2267,18 +2220,18 @@ PHP_FUNCTION(stats_rand_gen_iuniform) + /* }}} */ +  + /* {{{ proto float stats_rand_gen_funiform(float low, float high) +-   Generates uniform float between low (exclusive) and high (exclusive) */ ++	Generates uniform float between low (exclusive) and high (exclusive) */ + PHP_FUNCTION(stats_rand_gen_funiform) + { + 	double low; + 	double high; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &low, &high) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &low, &high) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (low > high) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "low greater than high. low : %16.6E  high : %16.6E", low, high); ++		php_error_docref(NULL, E_WARNING, "low greater than high. low : %16.6E  high : %16.6E", low, high); + 		RETURN_FALSE; + 	} +  +@@ -2287,7 +2240,7 @@ PHP_FUNCTION(stats_rand_gen_funiform) + /* }}} */ +  + /* {{{ proto int stats_rand_ignlgi(void) +-  Generates random integer between 1 and 2147483562 */ ++	Generates random integer between 1 and 2147483562 */ + PHP_FUNCTION(stats_rand_ignlgi) + { + 	if (ZEND_NUM_ARGS() != 0) { +@@ -2299,7 +2252,7 @@ PHP_FUNCTION(stats_rand_ignlgi) + /* }}} */ +  + /* {{{ proto float stats_rand_ranf(void) +-  Returns a random floating point number from a uniform distribution over 0 - 1 (endpoints of this interval are not returned) using the current generator */ ++	Returns a random floating point number from a uniform distribution over 0 - 1 (endpoints of this interval are not returned) using the current generator */ + PHP_FUNCTION(stats_rand_ranf) + { + 	if (ZEND_NUM_ARGS() != 0) { +@@ -2317,12 +2270,12 @@ PHP_FUNCTION(stats_rand_gen_beta) + 	double a; + 	double b; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &a, &b) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &a, &b) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (a < 1.0E-37 || b < 1.0E-37) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "'a' or 'b' lower than 1.0E-37. 'a' value : %16.6E  'b' value : %16.6E", a, b); ++		php_error_docref(NULL, E_WARNING, "'a' or 'b' lower than 1.0E-37. 'a' value : %16.6E  'b' value : %16.6E", a, b); + 		RETURN_FALSE; + 	} +  +@@ -2336,12 +2289,12 @@ PHP_FUNCTION(stats_rand_gen_chisquare) + { + 	double df; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &df) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &df) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (df <= 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "df <= 0.0. df : %16.6E", df); ++		php_error_docref(NULL, E_WARNING, "df <= 0.0. df : %16.6E", df); + 		RETURN_FALSE; + 	} +  +@@ -2355,12 +2308,12 @@ PHP_FUNCTION(stats_rand_gen_exponential) + { + 	double av; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &av) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &av) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (av < 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "av < 0.0"); ++		php_error_docref(NULL, E_WARNING, "av < 0.0"); + 		RETURN_FALSE; + 	} +  +@@ -2375,12 +2328,12 @@ PHP_FUNCTION(stats_rand_gen_f) + 	double dfn; + 	double dfd; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &dfn, &dfd) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &dfn, &dfd) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (dfn < 0.0 || dfd < 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Degrees of freedom nonpositive. DFN value:%16.6E DFD value:%16.6E", dfn, dfd); ++		php_error_docref(NULL, E_WARNING, "Degrees of freedom nonpositive. DFN value:%16.6E DFD value:%16.6E", dfn, dfd); + 		RETURN_FALSE; + 	} +  +@@ -2395,12 +2348,12 @@ PHP_FUNCTION(stats_rand_gen_gamma) + 	double a; + 	double r; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &a, &r) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &a, &r) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (!(a > 0.0 && r > 0.0)) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "A or R nonpositive. A value : %16.6E , R value : %16.6E", a, r); ++		php_error_docref(NULL, E_WARNING, "A or R nonpositive. A value : %16.6E , R value : %16.6E", a, r); + 		RETURN_FALSE; + 	} +  +@@ -2415,12 +2368,12 @@ PHP_FUNCTION(stats_rand_gen_noncentral_chisquare) + 	double df; + 	double xnonc; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &df, &xnonc) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &df, &xnonc) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (df < 1.0 || xnonc < 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "df < 1 or xnonc < 0. df value : %16.6E  xnonc value : %16.6E", df, xnonc); ++		php_error_docref(NULL, E_WARNING, "df < 1 or xnonc < 0. df value : %16.6E  xnonc value : %16.6E", df, xnonc); + 		RETURN_FALSE; + 	} +  +@@ -2428,20 +2381,20 @@ PHP_FUNCTION(stats_rand_gen_noncentral_chisquare) + } + /* }}} */ +  +-/* {{{ proto float stats_rand_gen_noncenral_f(float dfn, float dfd, float xnonc) ++/* {{{ proto float stats_rand_gen_noncentral_f(float dfn, float dfd, float xnonc) + 	Generates a random deviate from the noncentral F (variance ratio) distribution with "dfn" degrees of freedom  in the numerator, and "dfd" degrees of freedom in the denominator, and noncentrality parameter "xnonc". Method : directly generates ratio of noncentral numerator chisquare variate to central denominator chisquare variate. */ +-PHP_FUNCTION(stats_rand_gen_noncenral_f) ++PHP_FUNCTION(stats_rand_gen_noncentral_f) + { + 	double dfn; + 	double dfd; + 	double xnonc; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &dfn, &dfd, &xnonc) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ddd", &dfn, &dfd, &xnonc) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (dfn < 1.0 || dfd <= 0.0 || xnonc < 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn: %16.6E  dfd: %16.6E  xnonc: %16.6E", dfn, dfd, xnonc); ++		php_error_docref(NULL, E_WARNING, "Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn: %16.6E  dfd: %16.6E  xnonc: %16.6E", dfn, dfd, xnonc); + 		RETURN_FALSE; + 	} +  +@@ -2456,12 +2409,12 @@ PHP_FUNCTION(stats_rand_gen_normal) + 	double av; + 	double sd; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &av, &sd) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &av, &sd) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (sd < 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "sd < 0.0 . sd : %16.6E", sd); ++		php_error_docref(NULL, E_WARNING, "sd < 0.0 . sd : %16.6E", sd); + 		RETURN_FALSE; + 	} +  +@@ -2478,7 +2431,7 @@ PHP_FUNCTION(stats_rand_phrase_to_seeds) + 	long seed_1; + 	long seed_2; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &par1) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &par1) == FAILURE) { + 		RETURN_FALSE; + 	} + 	convert_to_string_ex(par1); +@@ -2500,12 +2453,12 @@ PHP_FUNCTION(stats_rand_ibinomial) + 	zend_long n; + 	double pp; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &n, &pp) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ld", &n, &pp) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if ((n < 0) || (pp < 0.0) || (pp > 1.0)) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad values for the arguments. n : %ld  pp : %16.6E", n, pp); ++		php_error_docref(NULL, E_WARNING, "Bad values for the arguments. n : %ld  pp : %16.6E", n, pp); + 		RETURN_FALSE; + 	} +  +@@ -2520,16 +2473,16 @@ PHP_FUNCTION(stats_rand_ibinomial_negative) + 	zend_long n; + 	double p; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ld", &n, &p) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ld", &n, &p) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (n <= 0L) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "n < 0. n : %ld", n); ++		php_error_docref(NULL, E_WARNING, "n < 0. n : %ld", n); + 		RETURN_FALSE; + 	} + 	if (p < 0.0F || p > 1.0F) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "p is out of range. p : %16.E", p); ++		php_error_docref(NULL, E_WARNING, "p is out of range. p : %16.E", p); + 		RETURN_FALSE; + 	} +  +@@ -2543,12 +2496,12 @@ PHP_FUNCTION(stats_rand_gen_ipoisson) + { + 	double mu; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &mu) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &mu) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (mu < 0.0F) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "mu < 0.0 . mu : %16.6E", mu); ++		php_error_docref(NULL, E_WARNING, "mu < 0.0 . mu : %16.6E", mu); + 		RETURN_FALSE; + 	} +  +@@ -2563,12 +2516,12 @@ PHP_FUNCTION(stats_rand_gen_noncentral_t) + 	double df; + 	double xnonc; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &df, &xnonc) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &df, &xnonc) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (df < 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "df <= 0 . df : %16.6E", df); ++		php_error_docref(NULL, E_WARNING, "df <= 0 . df : %16.6E", df); + 		RETURN_FALSE; + 	} +  +@@ -2583,7 +2536,7 @@ PHP_FUNCTION(stats_rand_gen_t) + 	zval *arg1; + 	double df; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &arg1) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &arg1) == FAILURE) { + 		RETURN_FALSE; + 	} +  +@@ -2591,7 +2544,7 @@ PHP_FUNCTION(stats_rand_gen_t) + 	df = Z_DVAL_P(arg1); +  + 	if (df <= 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "df <= 0 . df : %16.6E", df); ++		php_error_docref(NULL, E_WARNING, "df <= 0 . df : %16.6E", df); + 		RETURN_FALSE; + 	} +  +@@ -2613,13 +2566,13 @@ PHP_FUNCTION(stats_dens_normal) + 	double y; + 	double z; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddd", &x, &ave, &stdev) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (stdev == 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "stdev is 0.0"); ++		php_error_docref(NULL, E_WARNING, "stdev is 0.0"); + 		RETURN_FALSE; + 	} +  +@@ -2640,13 +2593,13 @@ PHP_FUNCTION(stats_dens_cauchy) + 	double y; + 	double z; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddd", &x, &ave, &stdev) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (stdev == 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "stdev is 0.0"); ++		php_error_docref(NULL, E_WARNING, "stdev is 0.0"); + 		RETURN_FALSE; + 	} +  +@@ -2667,13 +2620,13 @@ PHP_FUNCTION(stats_dens_laplace) + 	double y; + 	double z; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddd", &x, &ave, &stdev) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (stdev == 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "stdev is 0.0"); ++		php_error_docref(NULL, E_WARNING, "stdev is 0.0"); + 		RETURN_FALSE; + 	} +  +@@ -2694,13 +2647,13 @@ PHP_FUNCTION(stats_dens_logistic) + 	double y; + 	double z; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddd", &x, &ave, &stdev) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (stdev == 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "stdev is 0.0"); ++		php_error_docref(NULL, E_WARNING, "stdev is 0.0"); + 		RETURN_FALSE; + 	} +  +@@ -2721,7 +2674,7 @@ PHP_FUNCTION(stats_dens_beta) + 	double x; + 	double y; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &a, &b) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ddd", &x, &a, &b) == FAILURE) { + 		RETURN_FALSE; + 	} +  +@@ -2741,12 +2694,12 @@ PHP_FUNCTION(stats_dens_weibull) + 	double x; + 	double y; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &a, &b) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ddd", &x, &a, &b) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (b == 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "b is 0.0"); ++		php_error_docref(NULL, E_WARNING, "b is 0.0"); + 		RETURN_FALSE; + 	} +  +@@ -2765,13 +2718,13 @@ PHP_FUNCTION(stats_dens_uniform) + 	double x; + 	double y; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddd", &x, &a, &b) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (a == b) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "b == a == %16.6E", a); ++		php_error_docref(NULL, E_WARNING, "b == a == %16.6E", a); + 		RETURN_FALSE; + 	} +  +@@ -2795,7 +2748,7 @@ PHP_FUNCTION(stats_dens_chisquare) + 	double y; + 	double z; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"dd", &x, &dfr) == FAILURE) { + 		RETURN_FALSE; + 	} +@@ -2820,12 +2773,12 @@ PHP_FUNCTION(stats_dens_t) + 	double fac3; + 	double x; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &dfr) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &x, &dfr) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (dfr == 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "dfr == 0.0"); ++		php_error_docref(NULL, E_WARNING, "dfr == 0.0"); + 		RETURN_FALSE; + 	} +  +@@ -2848,12 +2801,12 @@ PHP_FUNCTION(stats_dens_gamma) + 	double x; + 	double z; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &shape, &scale) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ddd", &x, &shape, &scale) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (scale == 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "scale == 0.0"); ++		php_error_docref(NULL, E_WARNING, "scale == 0.0"); + 		RETURN_FALSE; + 	} +  +@@ -2875,12 +2828,12 @@ PHP_FUNCTION(stats_dens_exponential) + 	double x; + 	double y; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &scale) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &x, &scale) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if (scale == 0.0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "scale == 0.0"); ++		php_error_docref(NULL, E_WARNING, "scale == 0.0"); + 		RETURN_FALSE; + 	} +  +@@ -2895,7 +2848,7 @@ PHP_FUNCTION(stats_dens_exponential) + /* }}} */ +  + /* {{{ proto float stats_dens_f(float x, float dfr1, float dfr2) +-    Not documented */ ++	Not documented */ + PHP_FUNCTION(stats_dens_f) + { + 	double dfr1; +@@ -2909,7 +2862,7 @@ PHP_FUNCTION(stats_dens_f) + 	double x; + 	double z; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &dfr1, &dfr2) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ddd", &x, &dfr1, &dfr2) == FAILURE) { + 		RETURN_FALSE; + 	} +  +@@ -2949,7 +2902,7 @@ PHP_FUNCTION(stats_dens_pmf_binomial) + 	double n; + 	double x; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), + 						"ddd", &x, &n, &pi) == FAILURE) { + 		RETURN_FALSE; + 	} +@@ -2957,7 +2910,7 @@ PHP_FUNCTION(stats_dens_pmf_binomial) + 	if ((x == 0.0 && n == 0.0) || (pi == 0.0 && x == 0.0) + 		|| ( (1.0 - pi) == 0.0 && (n - x) == 0) ) { +  +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Params leading to pow(0, 0). x:%16.6E  n:%16.6E  pi:%16.6E", x, n, pi); ++		php_error_docref(NULL, E_WARNING, "Params leading to pow(0, 0). x:%16.6E  n:%16.6E  pi:%16.6E", x, n, pi); + 		RETURN_FALSE; + 	} +  +@@ -2975,7 +2928,7 @@ PHP_FUNCTION(stats_dens_pmf_poisson) + 	double z; + 	double x; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dd", &x, &lb) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dd", &x, &lb) == FAILURE) { + 		RETURN_FALSE; + 	} +  +@@ -2994,12 +2947,12 @@ PHP_FUNCTION(stats_dens_pmf_negative_binomial) + 	double n; + 	double x; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ddd", &x, &n, &pi) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ddd", &x, &n, &pi) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if ((pi == 0.0 && n == 0.0) || ((1.0 - pi) == 0.0 && x == 0.0)) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Params leading to pow(0, 0). x:%16.6E  n:%16.6E  pi:%16.6E", x, n, pi); ++		php_error_docref(NULL, E_WARNING, "Params leading to pow(0, 0). x:%16.6E  n:%16.6E  pi:%16.6E", x, n, pi); + 		RETURN_FALSE; + 	} +  +@@ -3010,7 +2963,7 @@ PHP_FUNCTION(stats_dens_pmf_negative_binomial) + /* }}} */ +  + /* {{{ proto float stats_dens_pmf_hypergeometric(float n1, float n2, float N1, float N2) +-    Not documented */ ++	Not documented */ + PHP_FUNCTION(stats_dens_pmf_hypergeometric) + { + 	double y; +@@ -3019,12 +2972,12 @@ PHP_FUNCTION(stats_dens_pmf_hypergeometric) + 	double n1; + 	double n2; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "dddd", &n1, &n2, &N1, &N2) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "dddd", &n1, &n2, &N1, &N2) == FAILURE) { + 		RETURN_FALSE; + 	} +  + 	if ((int)(n1 + n2) >= (int)(N1 + N2)) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "possible division by zero - n1+n2 >= N1+N2"); ++		php_error_docref(NULL, E_WARNING, "possible division by zero - n1+n2 >= N1+N2"); + 		/* RETURN_FALSE; */ + 	} +  +@@ -3047,7 +3000,7 @@ PHP_FUNCTION(stats_stat_powersum) + 	double power; + 	double sum = 0.0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z", &arg1, &arg2) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/z", &arg1, &arg2) == FAILURE) { + 		RETURN_FALSE; + 	} +  +@@ -3061,7 +3014,7 @@ PHP_FUNCTION(stats_stat_powersum) + 		if (Z_DVAL_P(data) != 0 || power != 0) { + 			sum += pow (Z_DVAL_P(data), power); + 		} else { +-			php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both value and power are zero"); ++			php_error_docref(NULL, E_WARNING, "Both value and power are zero"); + 		} + 		zend_hash_move_forward_ex(Z_ARRVAL_P(arg1), &pos); + 	} +@@ -3071,7 +3024,7 @@ PHP_FUNCTION(stats_stat_powersum) + /* }}} */ +  + /* {{{ proto float stats_stat_innerproduct(array arr1, array arr2) +-    Not documented */ ++	Not documented */ + PHP_FUNCTION(stats_stat_innerproduct) + { + 	zval *arg1, *arg2; +@@ -3081,14 +3034,14 @@ PHP_FUNCTION(stats_stat_innerproduct) + 	double sum = 0.0; +  +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &arg1, &arg2) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/z/", &arg1, &arg2) == FAILURE) { + 		RETURN_FALSE; + 	} + 	convert_to_array_ex(arg1); + 	convert_to_array_ex(arg2); +  + 	if (zend_hash_num_elements(Z_ARRVAL_P(arg1)) != zend_hash_num_elements(Z_ARRVAL_P(arg2))) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unequal number of X and Y coordinates"); ++		php_error_docref(NULL, E_WARNING, "Unequal number of X and Y coordinates"); + 		RETURN_FALSE; + 	} +  +@@ -3130,7 +3083,7 @@ PHP_FUNCTION(stats_stat_independent_t) + 	double fc; + 	double ts; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &arg1, &arg2) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/z/", &arg1, &arg2) == FAILURE) { + 		RETURN_FALSE; + 	} + 	convert_to_array_ex(arg1); +@@ -3139,7 +3092,7 @@ PHP_FUNCTION(stats_stat_independent_t) + 	xnum = zend_hash_num_elements(Z_ARRVAL_P(arg1)); + 	ynum = zend_hash_num_elements(Z_ARRVAL_P(arg2)); + 	if ( xnum < 2 ||  ynum < 2) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Each argument should have more than 1 element"); ++		php_error_docref(NULL, E_WARNING, "Each argument should have more than 1 element"); + 		RETURN_FALSE; + 	} +  +@@ -3189,7 +3142,7 @@ PHP_FUNCTION(stats_stat_paired_t) + 	double ts; + 	double cur; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &arg1, &arg2) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/z/", &arg1, &arg2) == FAILURE) { + 		RETURN_FALSE; + 	} + 	convert_to_array_ex(arg1); +@@ -3199,11 +3152,11 @@ PHP_FUNCTION(stats_stat_paired_t) + 	ynum = zend_hash_num_elements(Z_ARRVAL_P(arg2)); +  + 	if (xnum != ynum) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unequal number of X and Y coordinates"); ++		php_error_docref(NULL, E_WARNING, "Unequal number of X and Y coordinates"); + 		RETURN_FALSE; + 	} + 	if (xnum < 2) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "arr1 should have atleast 2 elements"); ++		php_error_docref(NULL, E_WARNING, "arr1 should have atleast 2 elements"); + 		RETURN_FALSE; + 	} +  +@@ -3231,7 +3184,7 @@ PHP_FUNCTION(stats_stat_paired_t) + /* }}} */ +  + /* {{{ proto float stats_stat_percentile(array arr, float perc) +-    Not documented */ ++	Not documented */ + PHP_FUNCTION(stats_stat_percentile) + { + 	zval *arg1, *arg2; +@@ -3246,7 +3199,7 @@ PHP_FUNCTION(stats_stat_percentile) + 	double upp; + 	double val = 0.0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z", &arg1, &arg2) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/z", &arg1, &arg2) == FAILURE) { + 		RETURN_FALSE; + 	} +  +@@ -3256,9 +3209,7 @@ PHP_FUNCTION(stats_stat_percentile) +  + 	xnum = zend_hash_num_elements(Z_ARRVAL_P(arg1)); +  +-	if (zend_hash_sort(Z_ARRVAL_P(arg1), stats_array_data_compare, 1) == FAILURE) { +-		RETURN_FALSE; +-	} ++	zend_hash_sort(Z_ARRVAL_P(arg1), stats_array_data_compare, 1); +  + 	zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arg1), &pos1); +  +@@ -3317,7 +3268,7 @@ PHP_FUNCTION(stats_stat_correlation) + 	double cc; + 	double rr; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z/", &arg1, &arg2) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "z/z/", &arg1, &arg2) == FAILURE) { + 		RETURN_FALSE; + 	} +  +@@ -3328,7 +3279,7 @@ PHP_FUNCTION(stats_stat_correlation) + 	ynum = zend_hash_num_elements(Z_ARRVAL_P(arg2)); +  + 	if (xnum != ynum) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unequal number of X and Y coordinates"); ++		php_error_docref(NULL, E_WARNING, "Unequal number of X and Y coordinates"); + 		RETURN_FALSE; + 	} +  +@@ -3371,7 +3322,7 @@ PHP_FUNCTION(stats_stat_binomial_coef) + 	zend_long x; + 	double bc = 1.0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x, &n) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll", &x, &n) == FAILURE) { + 		RETURN_FALSE; + 	} +  +@@ -3391,7 +3342,7 @@ PHP_FUNCTION(stats_stat_factorial) + 	zend_long i; + 	double f = 1; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &n) == FAILURE) { ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &n) == FAILURE) { + 		RETURN_FALSE; + 	} +  +@@ -3459,21 +3410,21 @@ static long double php_population_variance(zval *arr, zend_bool sample) +  +  + /* {{{ proto float stats_variance(array a [, bool sample = false]) +-    Returns the population variance */ ++	Returns the population variance */ + PHP_FUNCTION(stats_variance) + { + 	zval *arr; + 	zend_bool sample = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|b",  &arr, &sample) == FAILURE) { +-		return; ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|b",  &arr, &sample) == FAILURE) { ++		RETURN_FALSE; + 	} + 	if (zend_hash_num_elements(Z_ARRVAL_P(arr)) == 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array has zero elements"); ++		php_error_docref(NULL, E_WARNING, "The array has zero elements"); + 		RETURN_FALSE; + 	} + 	if (sample && zend_hash_num_elements(Z_ARRVAL_P(arr)) == 1) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array has only 1 element"); ++		php_error_docref(NULL, E_WARNING, "The array has only 1 element"); + 		RETURN_FALSE; + 	} + 	RETURN_DOUBLE(php_population_variance(arr, sample)); +@@ -3481,21 +3432,21 @@ PHP_FUNCTION(stats_variance) + /* }}} */ +  + /* {{{ proto float stats_standard_deviation(array a [, bool sample = false]) +-    Returns the standard deviation */ ++	Returns the standard deviation */ + PHP_FUNCTION(stats_standard_deviation) + { + 	zval *arr; + 	zend_bool sample = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/|b",  &arr, &sample) == FAILURE) { +-		return; ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/|b",  &arr, &sample) == FAILURE) { ++		RETURN_FALSE; + 	} + 	if (zend_hash_num_elements(Z_ARRVAL_P(arr)) == 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array has zero elements"); ++		php_error_docref(NULL, E_WARNING, "The array has zero elements"); + 		RETURN_FALSE; + 	} + 	if (sample && zend_hash_num_elements(Z_ARRVAL_P(arr)) == 1) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array has only 1 element"); ++		php_error_docref(NULL, E_WARNING, "The array has only 1 element"); + 		RETURN_FALSE; + 	} + 	RETURN_DOUBLE(sqrt(php_population_variance(arr, sample))); +@@ -3504,7 +3455,7 @@ PHP_FUNCTION(stats_standard_deviation) +  +  + /* {{{ proto float stats_absolute_deviation(array a) +-    Returns the absolute deviation of an array of values */ ++	Returns the absolute deviation of an array of values */ + PHP_FUNCTION(stats_absolute_deviation) + { + 	zval *arr; +@@ -3513,11 +3464,11 @@ PHP_FUNCTION(stats_absolute_deviation) + 	HashPosition pos; + 	int elements_num; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/",  &arr) == FAILURE) { +-		return; ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/",  &arr) == FAILURE) { ++		RETURN_FALSE; + 	} + 	if ((elements_num = zend_hash_num_elements(Z_ARRVAL_P(arr))) == 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array has zero elements"); ++		php_error_docref(NULL, E_WARNING, "The array has zero elements"); + 		RETURN_FALSE; + 	} +  +@@ -3534,7 +3485,7 @@ PHP_FUNCTION(stats_absolute_deviation) + /* }}} */ +  + /* {{{ proto float stats_harmonic_mean(array a) +-    Returns the harmonic mean of an array of values */ ++	Returns the harmonic mean of an array of values */ + PHP_FUNCTION(stats_harmonic_mean) + { + 	zval *arr; +@@ -3543,11 +3494,11 @@ PHP_FUNCTION(stats_harmonic_mean) + 	HashPosition pos; + 	int elements_num; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/",  &arr) == FAILURE) { +-		return; ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/",  &arr) == FAILURE) { ++		RETURN_FALSE; + 	} + 	if ((elements_num = zend_hash_num_elements(Z_ARRVAL_P(arr))) == 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array has zero elements"); ++		php_error_docref(NULL, E_WARNING, "The array has zero elements"); + 		RETURN_FALSE; + 	} +  +@@ -3566,7 +3517,7 @@ PHP_FUNCTION(stats_harmonic_mean) + /* }}} */ +  + /* {{{ proto float stats_skew(array a) +-    Computes the skewness of the data in the array */ ++	Computes the skewness of the data in the array */ + PHP_FUNCTION(stats_skew) + { + 	zval *arr; +@@ -3575,11 +3526,11 @@ PHP_FUNCTION(stats_skew) + 	HashPosition pos; + 	int elements_num, i = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/",  &arr) == FAILURE) { +-		return; ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/",  &arr) == FAILURE) { ++		RETURN_FALSE; + 	} + 	if ((elements_num = zend_hash_num_elements(Z_ARRVAL_P(arr))) == 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array has zero elements"); ++		php_error_docref(NULL, E_WARNING, "The array has zero elements"); + 		RETURN_FALSE; + 	} +  +@@ -3604,7 +3555,7 @@ PHP_FUNCTION(stats_skew) + /* }}} */ +  + /* {{{ proto float stats_kurtosis(array a) +-    Computes the kurtosis of the data in the array */ ++	Computes the kurtosis of the data in the array */ + PHP_FUNCTION(stats_kurtosis) + { + 	zval *arr; +@@ -3613,11 +3564,11 @@ PHP_FUNCTION(stats_kurtosis) + 	HashPosition pos; + 	int elements_num, i = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/",  &arr) == FAILURE) { +-		return; ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/",  &arr) == FAILURE) { ++		RETURN_FALSE; + 	} + 	if ((elements_num = zend_hash_num_elements(Z_ARRVAL_P(arr))) == 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The array has zero elements"); ++		php_error_docref(NULL, E_WARNING, "The array has zero elements"); + 		RETURN_FALSE; + 	} +  +@@ -3644,7 +3595,7 @@ PHP_FUNCTION(stats_kurtosis) +  +  + /* {{{ proto float stats_covariance(array a, array b) +-    Computes the covariance of two data sets */ ++	Computes the covariance of two data sets */ + PHP_FUNCTION(stats_covariance) + { + 	zval *arr_1, *arr_2; +@@ -3653,19 +3604,19 @@ PHP_FUNCTION(stats_covariance) + 	HashPosition pos_1, pos_2; + 	int elements_num, i = 0; +  +-	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/a/",  &arr_1, &arr_2) == FAILURE) { +-		return; ++	if (zend_parse_parameters(ZEND_NUM_ARGS(), "a/a/",  &arr_1, &arr_2) == FAILURE) { ++		RETURN_FALSE; + 	} + 	if ((elements_num = zend_hash_num_elements(Z_ARRVAL_P(arr_1))) == 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The first array has zero elements"); ++		php_error_docref(NULL, E_WARNING, "The first array has zero elements"); + 		RETURN_FALSE; + 	} + 	if (zend_hash_num_elements(Z_ARRVAL_P(arr_2)) == 0) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The second array has zero elements"); ++		php_error_docref(NULL, E_WARNING, "The second array has zero elements"); + 		RETURN_FALSE; + 	} + 	if (elements_num != zend_hash_num_elements(Z_ARRVAL_P(arr_2))) { +-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "The datasets are not of the same size"); ++		php_error_docref(NULL, E_WARNING, "The datasets are not of the same size"); + 		RETURN_FALSE; + 	} +  +diff --git a/php_stats.h b/php_stats.h +index af449b3..090ef3d 100644 +--- a/php_stats.h ++++ b/php_stats.h +@@ -16,8 +16,6 @@ +   +----------------------------------------------------------------------+ + */ +  +-/* $Id$ */ +- + #ifndef PHP_STATS_H + #define PHP_STATS_H +  +@@ -35,77 +33,6 @@ extern zend_module_entry stats_module_entry; +  + PHP_MINFO_FUNCTION(stats); +  +-PHP_FUNCTION(stats_cdf_t); +-PHP_FUNCTION(stats_cdf_normal); +-PHP_FUNCTION(stats_cdf_gamma); +-PHP_FUNCTION(stats_cdf_chisquare); +-PHP_FUNCTION(stats_cdf_beta); +-PHP_FUNCTION(stats_cdf_binomial); +-PHP_FUNCTION(stats_cdf_noncentral_chisquare); +-PHP_FUNCTION(stats_cdf_f); +-PHP_FUNCTION(stats_cdf_noncentral_f); +-PHP_FUNCTION(stats_cdf_noncentral_t); +-PHP_FUNCTION(stats_cdf_negative_binomial); +-PHP_FUNCTION(stats_cdf_poisson); +-PHP_FUNCTION(stats_cdf_laplace); +-PHP_FUNCTION(stats_cdf_cauchy); +-PHP_FUNCTION(stats_cdf_logistic); +-PHP_FUNCTION(stats_cdf_weibull); +-PHP_FUNCTION(stats_cdf_uniform); +-PHP_FUNCTION(stats_cdf_exponential); +-PHP_FUNCTION(stats_rand_setall); +-PHP_FUNCTION(stats_rand_getsd); +-PHP_FUNCTION(stats_rand_gen_iuniform); +-PHP_FUNCTION(stats_rand_gen_funiform); +-PHP_FUNCTION(stats_rand_ignlgi); +-PHP_FUNCTION(stats_rand_ranf); +-PHP_FUNCTION(stats_rand_gen_beta); +-PHP_FUNCTION(stats_rand_gen_chisquare); +-PHP_FUNCTION(stats_rand_gen_exponential); +-PHP_FUNCTION(stats_rand_gen_f); +-PHP_FUNCTION(stats_rand_gen_gamma); +-PHP_FUNCTION(stats_rand_gen_noncentral_chisquare); +-PHP_FUNCTION(stats_rand_gen_noncenral_f); +-PHP_FUNCTION(stats_rand_gen_normal); +-PHP_FUNCTION(stats_rand_phrase_to_seeds); +-PHP_FUNCTION(stats_rand_ibinomial); +-PHP_FUNCTION(stats_rand_ibinomial_negative); +-PHP_FUNCTION(stats_rand_gen_ipoisson); +-PHP_FUNCTION(stats_rand_gen_noncentral_t); +-PHP_FUNCTION(stats_rand_gen_t); +-PHP_FUNCTION(stats_dens_normal); +-PHP_FUNCTION(stats_dens_cauchy); +-PHP_FUNCTION(stats_dens_laplace); +-PHP_FUNCTION(stats_dens_logistic); +-PHP_FUNCTION(stats_dens_beta); +-PHP_FUNCTION(stats_dens_weibull); +-PHP_FUNCTION(stats_dens_uniform); +-PHP_FUNCTION(stats_dens_chisquare); +-PHP_FUNCTION(stats_dens_t); +-PHP_FUNCTION(stats_dens_gamma); +-PHP_FUNCTION(stats_dens_exponential); +-PHP_FUNCTION(stats_dens_f); +-PHP_FUNCTION(stats_dens_pmf_binomial); +-PHP_FUNCTION(stats_dens_pmf_poisson); +-PHP_FUNCTION(stats_dens_pmf_negative_binomial); +-PHP_FUNCTION(stats_dens_pmf_hypergeometric); +-PHP_FUNCTION(stats_stat_powersum); +-PHP_FUNCTION(stats_stat_innerproduct); +-PHP_FUNCTION(stats_stat_independent_t); +-PHP_FUNCTION(stats_stat_paired_t); +-PHP_FUNCTION(stats_stat_percentile); +-PHP_FUNCTION(stats_stat_correlation); +-PHP_FUNCTION(stats_stat_binomial_coef); +-PHP_FUNCTION(stats_stat_factorial); +-PHP_FUNCTION(stats_variance); +-PHP_FUNCTION(stats_standard_deviation); +-PHP_FUNCTION(stats_absolute_deviation); +-PHP_FUNCTION(stats_harmonic_mean); +-PHP_FUNCTION(stats_skew); +-PHP_FUNCTION(stats_kurtosis); +-PHP_FUNCTION(stats_covariance); +- +- + #ifdef ZTS + #define STATS_D zend_stats_globals *stats_globals + #define STATS_G(v) (stats_globals->v) +diff --git a/stats_arginfo.h b/stats_arginfo.h +new file mode 100644 +index 0000000..3c99ebf +--- /dev/null ++++ b/stats_arginfo.h +@@ -0,0 +1,406 @@ ++/* This is a generated file, edit the .stub.php file instead. ++ * Stub hash: e6cfe06b9c3e187348f16fd6a34bb7eafc5042d9 */ ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_cdf_t, 0, 3, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, par1, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, par2, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, which, IS_LONG, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_cdf_normal, 0, 4, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, par1, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, par2, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, par3, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, which, IS_LONG, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_cdf_gamma arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_chisquare arginfo_stats_cdf_t ++ ++#define arginfo_stats_cdf_beta arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_binomial arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_noncentral_chisquare arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_f arginfo_stats_cdf_normal ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_cdf_noncentral_f, 0, 5, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, par1, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, par2, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, par3, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, par4, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, which, IS_LONG, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_cdf_noncentral_t arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_negative_binomial arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_poisson arginfo_stats_cdf_t ++ ++#define arginfo_stats_cdf_laplace arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_cauchy arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_logistic arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_weibull arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_uniform arginfo_stats_cdf_normal ++ ++#define arginfo_stats_cdf_exponential arginfo_stats_cdf_t ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stats_rand_setall, 0, 2, _IS_BOOL, 0) ++	ZEND_ARG_TYPE_INFO(0, iseed1, IS_LONG, 0) ++	ZEND_ARG_TYPE_INFO(0, iseed2, IS_LONG, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stats_rand_getsd, 0, 0, IS_ARRAY, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_iuniform, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, low, IS_LONG, 0) ++	ZEND_ARG_TYPE_INFO(0, high, IS_LONG, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_funiform, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, low, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, high, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stats_rand_ignlgi, 0, 0, IS_LONG, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_ranf, 0, 0, MAY_BE_DOUBLE|MAY_BE_FALSE) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_beta, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, a, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, b, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_chisquare, 0, 1, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, df, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_exponential, 0, 1, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, av, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_f, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, dfn, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, dfd, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_gamma, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, a, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, r, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_noncentral_chisquare, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, df, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, xnonc, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_noncentral_f, 0, 3, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, dfn, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, dfd, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, xnonc, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_rand_gen_noncenral_f arginfo_stats_rand_gen_noncentral_f ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_normal, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, av, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, sd, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_phrase_to_seeds, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, phrase, IS_STRING, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_ibinomial, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, n, IS_LONG, 0) ++	ZEND_ARG_TYPE_INFO(0, pp, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_ibinomial_negative, 0, 2, MAY_BE_LONG|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, n, IS_LONG, 0) ++	ZEND_ARG_TYPE_INFO(0, p, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_ipoisson, 0, 1, MAY_BE_LONG|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, mu, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_rand_gen_noncentral_t arginfo_stats_rand_gen_noncentral_chisquare ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_rand_gen_t, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, df, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_dens_normal, 0, 3, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, ave, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, stdev, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_dens_cauchy arginfo_stats_dens_normal ++ ++#define arginfo_stats_dens_laplace arginfo_stats_dens_normal ++ ++#define arginfo_stats_dens_logistic arginfo_stats_dens_normal ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_dens_beta, 0, 3, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, a, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, b, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_dens_weibull arginfo_stats_dens_beta ++ ++#define arginfo_stats_dens_uniform arginfo_stats_dens_beta ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_dens_chisquare, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, dfr, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_dens_t arginfo_stats_dens_chisquare ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_dens_gamma, 0, 3, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, shape, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_dens_exponential, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, scale, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_dens_f, 0, 3, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, dfr1, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, dfr2, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_dens_pmf_binomial, 0, 3, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, n, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, pi, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_dens_pmf_poisson, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, x, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, lb, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_dens_pmf_negative_binomial arginfo_stats_dens_pmf_binomial ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_dens_pmf_hypergeometric, 0, 4, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, n1, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, n2, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, N1, IS_DOUBLE, 0) ++	ZEND_ARG_TYPE_INFO(0, N2, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_stat_powersum, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, arr, IS_ARRAY, 0) ++	ZEND_ARG_TYPE_INFO(0, power, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_stat_innerproduct, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, arr1, IS_ARRAY, 0) ++	ZEND_ARG_TYPE_INFO(0, arr2, IS_ARRAY, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_stat_independent_t arginfo_stats_stat_innerproduct ++ ++#define arginfo_stats_stat_paired_t arginfo_stats_stat_innerproduct ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_stat_percentile, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, arr, IS_ARRAY, 0) ++	ZEND_ARG_TYPE_INFO(0, perc, IS_DOUBLE, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_stat_correlation arginfo_stats_stat_innerproduct ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_stat_binomial_coef, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, x, IS_LONG, 0) ++	ZEND_ARG_TYPE_INFO(0, n, IS_LONG, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_stat_factorial, 0, 1, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, n, IS_LONG, 0) ++ZEND_END_ARG_INFO() ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_variance, 0, 1, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, a, IS_ARRAY, 0) ++	ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, sample, _IS_BOOL, 0, "false") ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_standard_deviation arginfo_stats_variance ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_absolute_deviation, 0, 1, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, a, IS_ARRAY, 0) ++ZEND_END_ARG_INFO() ++ ++#define arginfo_stats_harmonic_mean arginfo_stats_absolute_deviation ++ ++#define arginfo_stats_skew arginfo_stats_absolute_deviation ++ ++#define arginfo_stats_kurtosis arginfo_stats_absolute_deviation ++ ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_stats_covariance, 0, 2, MAY_BE_DOUBLE|MAY_BE_FALSE) ++	ZEND_ARG_TYPE_INFO(0, a, IS_ARRAY, 0) ++	ZEND_ARG_TYPE_INFO(0, b, IS_ARRAY, 0) ++ZEND_END_ARG_INFO() ++ ++ ++ZEND_FUNCTION(stats_cdf_t); ++ZEND_FUNCTION(stats_cdf_normal); ++ZEND_FUNCTION(stats_cdf_gamma); ++ZEND_FUNCTION(stats_cdf_chisquare); ++ZEND_FUNCTION(stats_cdf_beta); ++ZEND_FUNCTION(stats_cdf_binomial); ++ZEND_FUNCTION(stats_cdf_noncentral_chisquare); ++ZEND_FUNCTION(stats_cdf_f); ++ZEND_FUNCTION(stats_cdf_noncentral_f); ++ZEND_FUNCTION(stats_cdf_noncentral_t); ++ZEND_FUNCTION(stats_cdf_negative_binomial); ++ZEND_FUNCTION(stats_cdf_poisson); ++ZEND_FUNCTION(stats_cdf_laplace); ++ZEND_FUNCTION(stats_cdf_cauchy); ++ZEND_FUNCTION(stats_cdf_logistic); ++ZEND_FUNCTION(stats_cdf_weibull); ++ZEND_FUNCTION(stats_cdf_uniform); ++ZEND_FUNCTION(stats_cdf_exponential); ++ZEND_FUNCTION(stats_rand_setall); ++ZEND_FUNCTION(stats_rand_getsd); ++ZEND_FUNCTION(stats_rand_gen_iuniform); ++ZEND_FUNCTION(stats_rand_gen_funiform); ++ZEND_FUNCTION(stats_rand_ignlgi); ++ZEND_FUNCTION(stats_rand_ranf); ++ZEND_FUNCTION(stats_rand_gen_beta); ++ZEND_FUNCTION(stats_rand_gen_chisquare); ++ZEND_FUNCTION(stats_rand_gen_exponential); ++ZEND_FUNCTION(stats_rand_gen_f); ++ZEND_FUNCTION(stats_rand_gen_gamma); ++ZEND_FUNCTION(stats_rand_gen_noncentral_chisquare); ++ZEND_FUNCTION(stats_rand_gen_noncentral_f); ++ZEND_FUNCTION(stats_rand_gen_normal); ++ZEND_FUNCTION(stats_rand_phrase_to_seeds); ++ZEND_FUNCTION(stats_rand_ibinomial); ++ZEND_FUNCTION(stats_rand_ibinomial_negative); ++ZEND_FUNCTION(stats_rand_gen_ipoisson); ++ZEND_FUNCTION(stats_rand_gen_noncentral_t); ++ZEND_FUNCTION(stats_rand_gen_t); ++ZEND_FUNCTION(stats_dens_normal); ++ZEND_FUNCTION(stats_dens_cauchy); ++ZEND_FUNCTION(stats_dens_laplace); ++ZEND_FUNCTION(stats_dens_logistic); ++ZEND_FUNCTION(stats_dens_beta); ++ZEND_FUNCTION(stats_dens_weibull); ++ZEND_FUNCTION(stats_dens_uniform); ++ZEND_FUNCTION(stats_dens_chisquare); ++ZEND_FUNCTION(stats_dens_t); ++ZEND_FUNCTION(stats_dens_gamma); ++ZEND_FUNCTION(stats_dens_exponential); ++ZEND_FUNCTION(stats_dens_f); ++ZEND_FUNCTION(stats_dens_pmf_binomial); ++ZEND_FUNCTION(stats_dens_pmf_poisson); ++ZEND_FUNCTION(stats_dens_pmf_negative_binomial); ++ZEND_FUNCTION(stats_dens_pmf_hypergeometric); ++ZEND_FUNCTION(stats_stat_powersum); ++ZEND_FUNCTION(stats_stat_innerproduct); ++ZEND_FUNCTION(stats_stat_independent_t); ++ZEND_FUNCTION(stats_stat_paired_t); ++ZEND_FUNCTION(stats_stat_percentile); ++ZEND_FUNCTION(stats_stat_correlation); ++ZEND_FUNCTION(stats_stat_binomial_coef); ++ZEND_FUNCTION(stats_stat_factorial); ++ZEND_FUNCTION(stats_variance); ++ZEND_FUNCTION(stats_standard_deviation); ++ZEND_FUNCTION(stats_absolute_deviation); ++ZEND_FUNCTION(stats_harmonic_mean); ++ZEND_FUNCTION(stats_skew); ++ZEND_FUNCTION(stats_kurtosis); ++ZEND_FUNCTION(stats_covariance); ++ ++ ++static const zend_function_entry ext_functions[] = { ++	ZEND_FE(stats_cdf_t, arginfo_stats_cdf_t) ++	ZEND_FE(stats_cdf_normal, arginfo_stats_cdf_normal) ++	ZEND_FE(stats_cdf_gamma, arginfo_stats_cdf_gamma) ++	ZEND_FE(stats_cdf_chisquare, arginfo_stats_cdf_chisquare) ++	ZEND_FE(stats_cdf_beta, arginfo_stats_cdf_beta) ++	ZEND_FE(stats_cdf_binomial, arginfo_stats_cdf_binomial) ++	ZEND_FE(stats_cdf_noncentral_chisquare, arginfo_stats_cdf_noncentral_chisquare) ++	ZEND_FE(stats_cdf_f, arginfo_stats_cdf_f) ++	ZEND_FE(stats_cdf_noncentral_f, arginfo_stats_cdf_noncentral_f) ++	ZEND_FE(stats_cdf_noncentral_t, arginfo_stats_cdf_noncentral_t) ++	ZEND_FE(stats_cdf_negative_binomial, arginfo_stats_cdf_negative_binomial) ++	ZEND_FE(stats_cdf_poisson, arginfo_stats_cdf_poisson) ++	ZEND_FE(stats_cdf_laplace, arginfo_stats_cdf_laplace) ++	ZEND_FE(stats_cdf_cauchy, arginfo_stats_cdf_cauchy) ++	ZEND_FE(stats_cdf_logistic, arginfo_stats_cdf_logistic) ++	ZEND_FE(stats_cdf_weibull, arginfo_stats_cdf_weibull) ++	ZEND_FE(stats_cdf_uniform, arginfo_stats_cdf_uniform) ++	ZEND_FE(stats_cdf_exponential, arginfo_stats_cdf_exponential) ++	ZEND_FE(stats_rand_setall, arginfo_stats_rand_setall) ++	ZEND_FE(stats_rand_getsd, arginfo_stats_rand_getsd) ++	ZEND_FE(stats_rand_gen_iuniform, arginfo_stats_rand_gen_iuniform) ++	ZEND_FE(stats_rand_gen_funiform, arginfo_stats_rand_gen_funiform) ++	ZEND_FE(stats_rand_ignlgi, arginfo_stats_rand_ignlgi) ++	ZEND_FE(stats_rand_ranf, arginfo_stats_rand_ranf) ++	ZEND_FE(stats_rand_gen_beta, arginfo_stats_rand_gen_beta) ++	ZEND_FE(stats_rand_gen_chisquare, arginfo_stats_rand_gen_chisquare) ++	ZEND_FE(stats_rand_gen_exponential, arginfo_stats_rand_gen_exponential) ++	ZEND_FE(stats_rand_gen_f, arginfo_stats_rand_gen_f) ++	ZEND_FE(stats_rand_gen_gamma, arginfo_stats_rand_gen_gamma) ++	ZEND_FE(stats_rand_gen_noncentral_chisquare, arginfo_stats_rand_gen_noncentral_chisquare) ++	ZEND_FE(stats_rand_gen_noncentral_f, arginfo_stats_rand_gen_noncentral_f) ++	ZEND_FALIAS(stats_rand_gen_noncenral_f, stats_rand_gen_noncentral_f, arginfo_stats_rand_gen_noncenral_f) ++	ZEND_FE(stats_rand_gen_normal, arginfo_stats_rand_gen_normal) ++	ZEND_FE(stats_rand_phrase_to_seeds, arginfo_stats_rand_phrase_to_seeds) ++	ZEND_FE(stats_rand_ibinomial, arginfo_stats_rand_ibinomial) ++	ZEND_FE(stats_rand_ibinomial_negative, arginfo_stats_rand_ibinomial_negative) ++	ZEND_FE(stats_rand_gen_ipoisson, arginfo_stats_rand_gen_ipoisson) ++	ZEND_FE(stats_rand_gen_noncentral_t, arginfo_stats_rand_gen_noncentral_t) ++	ZEND_FE(stats_rand_gen_t, arginfo_stats_rand_gen_t) ++	ZEND_FE(stats_dens_normal, arginfo_stats_dens_normal) ++	ZEND_FE(stats_dens_cauchy, arginfo_stats_dens_cauchy) ++	ZEND_FE(stats_dens_laplace, arginfo_stats_dens_laplace) ++	ZEND_FE(stats_dens_logistic, arginfo_stats_dens_logistic) ++	ZEND_FE(stats_dens_beta, arginfo_stats_dens_beta) ++	ZEND_FE(stats_dens_weibull, arginfo_stats_dens_weibull) ++	ZEND_FE(stats_dens_uniform, arginfo_stats_dens_uniform) ++	ZEND_FE(stats_dens_chisquare, arginfo_stats_dens_chisquare) ++	ZEND_FE(stats_dens_t, arginfo_stats_dens_t) ++	ZEND_FE(stats_dens_gamma, arginfo_stats_dens_gamma) ++	ZEND_FE(stats_dens_exponential, arginfo_stats_dens_exponential) ++	ZEND_FE(stats_dens_f, arginfo_stats_dens_f) ++	ZEND_FE(stats_dens_pmf_binomial, arginfo_stats_dens_pmf_binomial) ++	ZEND_FE(stats_dens_pmf_poisson, arginfo_stats_dens_pmf_poisson) ++	ZEND_FE(stats_dens_pmf_negative_binomial, arginfo_stats_dens_pmf_negative_binomial) ++	ZEND_FE(stats_dens_pmf_hypergeometric, arginfo_stats_dens_pmf_hypergeometric) ++	ZEND_FE(stats_stat_powersum, arginfo_stats_stat_powersum) ++	ZEND_FE(stats_stat_innerproduct, arginfo_stats_stat_innerproduct) ++	ZEND_FE(stats_stat_independent_t, arginfo_stats_stat_independent_t) ++	ZEND_FE(stats_stat_paired_t, arginfo_stats_stat_paired_t) ++	ZEND_FE(stats_stat_percentile, arginfo_stats_stat_percentile) ++	ZEND_FE(stats_stat_correlation, arginfo_stats_stat_correlation) ++	ZEND_FE(stats_stat_binomial_coef, arginfo_stats_stat_binomial_coef) ++	ZEND_FE(stats_stat_factorial, arginfo_stats_stat_factorial) ++	ZEND_FE(stats_variance, arginfo_stats_variance) ++	ZEND_FE(stats_standard_deviation, arginfo_stats_standard_deviation) ++	ZEND_FE(stats_absolute_deviation, arginfo_stats_absolute_deviation) ++	ZEND_FE(stats_harmonic_mean, arginfo_stats_harmonic_mean) ++	ZEND_FE(stats_skew, arginfo_stats_skew) ++	ZEND_FE(stats_kurtosis, arginfo_stats_kurtosis) ++	ZEND_FE(stats_covariance, arginfo_stats_covariance) ++	ZEND_FE_END ++}; +diff --git a/tests/stats_dens_pmf_binomial.phpt b/tests/stats_dens_pmf_binomial.phpt +index 35db3f3..9eaa93c 100644 +--- a/tests/stats_dens_pmf_binomial.phpt ++++ b/tests/stats_dens_pmf_binomial.phpt +@@ -1,5 +1,7 @@ + --TEST-- + stats_dens_pmf_binomial() ++--INI-- ++serialize_precision=14 + --FILE-- + <?php + // check for each x +diff --git a/tests/stats_dens_pmf_negative_binomial.phpt b/tests/stats_dens_pmf_negative_binomial.phpt +index 11704ff..6706c55 100644 +--- a/tests/stats_dens_pmf_negative_binomial.phpt ++++ b/tests/stats_dens_pmf_negative_binomial.phpt +@@ -1,5 +1,7 @@ + --TEST-- + stats_dens_pmf_negative_binomial() ++--INI-- ++serialize_precision=14 + --FILE-- + <?php + // check for each x +diff --git a/tests/stats_rand_gen_noncenral_f.phpt b/tests/stats_rand_gen_noncenral_f.phpt +deleted file mode 100644 +index c0bb6e8..0000000 +--- a/tests/stats_rand_gen_noncenral_f.phpt ++++ /dev/null +@@ -1,26 +0,0 @@ +---TEST-- +-stats_rand_gen_noncenral_f() +---FILE-- +-<?php +-var_dump(is_float(stats_rand_gen_noncenral_f(2, 3, 4))); +- +-// error cases +-var_dump(stats_rand_gen_noncenral_f(0.9, 3, 4));    // dfn < 1 +-var_dump(stats_rand_gen_noncenral_f(2, -0.1, 4));   // dfd < 0 +-var_dump(stats_rand_gen_noncenral_f(2, 0, 4));      // dfd == 0 +-var_dump(stats_rand_gen_noncenral_f(2, 3, -0.1));   // xnonc < 0 +-?> +---EXPECTF-- +-bool(true) +- +-Warning: stats_rand_gen_noncenral_f(): Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn:      9.000000E-1  dfd:      3.000000E+0  xnonc:      4.000000E+0 in %s on line %d +-bool(false) +- +-Warning: stats_rand_gen_noncenral_f(): Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn:      2.000000E+0  dfd:     -1.000000E-1  xnonc:      4.000000E+0 in %s on line %d +-bool(false) +- +-Warning: stats_rand_gen_noncenral_f(): Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn:      2.000000E+0  dfd:      0.000000E+0  xnonc:      4.000000E+0 in %s on line %d +-bool(false) +- +-Warning: stats_rand_gen_noncenral_f(): Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn:      2.000000E+0  dfd:      3.000000E+0  xnonc:     -1.000000E-1 in %s on line %d +-bool(false) +diff --git a/tests/stats_rand_gen_noncentral_f.phpt b/tests/stats_rand_gen_noncentral_f.phpt +new file mode 100644 +index 0000000..30f6426 +--- /dev/null ++++ b/tests/stats_rand_gen_noncentral_f.phpt +@@ -0,0 +1,28 @@ ++--TEST-- ++stats_rand_gen_noncentral_f() ++--INI-- ++serialize_precision=14 ++--FILE-- ++<?php ++var_dump(is_float(stats_rand_gen_noncentral_f(2, 3, 4))); ++ ++// error cases ++var_dump(stats_rand_gen_noncentral_f(0.9, 3, 4));    // dfn < 1 ++var_dump(stats_rand_gen_noncentral_f(2, -0.1, 4));   // dfd < 0 ++var_dump(stats_rand_gen_noncentral_f(2, 0, 4));      // dfd == 0 ++var_dump(stats_rand_gen_noncentral_f(2, 3, -0.1));   // xnonc < 0 ++?> ++--EXPECTF-- ++bool(true) ++ ++Warning: stats_rand_gen_noncentral_f(): Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn:      9.000000E-1  dfd:      3.000000E+0  xnonc:      4.000000E+0 in %s on line %d ++bool(false) ++ ++Warning: stats_rand_gen_noncentral_f(): Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn:      2.000000E+0  dfd:     -1.000000E-1  xnonc:      4.000000E+0 in %s on line %d ++bool(false) ++ ++Warning: stats_rand_gen_noncentral_f(): Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn:      2.000000E+0  dfd:      0.000000E+0  xnonc:      4.000000E+0 in %s on line %d ++bool(false) ++ ++Warning: stats_rand_gen_noncentral_f(): Either (1) Numerator df < 1.0 or (2) Denominator df <= 0.0 or (3) Noncentrality parameter < 0.0. dfn:      2.000000E+0  dfd:      3.000000E+0  xnonc:     -1.000000E-1 in %s on line %d ++bool(false) +diff --git a/tests/stats_standard_deviation.phpt b/tests/stats_standard_deviation.phpt +index 8957531..8ca7313 100644 +--- a/tests/stats_standard_deviation.phpt ++++ b/tests/stats_standard_deviation.phpt +@@ -1,5 +1,7 @@ + --TEST-- + stats_standard_deviation() ++--INI-- ++serialize_precision=14 + --FILE-- + <?php + $a=array(4, 1, 7);  | 
