PECL stats_rand_gen_normal always returns the same value

Viewed 163

With PHP 7.3, I'm trying to use the PECL stats extension: https://pecl.php.net/package/stats

Especially, I'm interested in generating random values following a normal distribution, with the function stats_rand_gen_normal

In my script, the function always returns the same result. I tried in CLI, to be sure :

php -r "echo(stats_rand_gen_normal(0,1));"

Every execution prints the same number.

So it's a random value which is always the same... What am I missing here?

2 Answers

This seems to me like a bug too and I have make a bug report. There is a solution on stackoverflow using a custom function.

Related