Re: [PHP-DEV] Re: Reseeding rand()/mt_rand()

2017-01-31 Thread Yasuo Ohgaki
Hi all, On Wed, Feb 1, 2017 at 5:48 AM, Andrea Faulds wrote: > Yasuo Ohgaki wrote: > >> My current objective is to make existing API to work, so resource may be >> used >> to set/get PRNG state. >> > > I would prefer it if we not introduce a new usage of resources. An object > would suffice. > >

Re: [PHP-DEV] Re: Reseeding rand()/mt_rand()

2017-01-31 Thread Andrea Faulds
Hi, Yasuo Ohgaki wrote: My current objective is to make existing API to work, so resource may be used to set/get PRNG state. I would prefer it if we not introduce a new usage of resources. An object would suffice. *** Initialize and Create new PRNG state resource *** resource mt_srand([int

Re: [PHP-DEV] Re: Reseeding rand()/mt_rand()

2017-01-31 Thread Yasuo Ohgaki
Hi Andrea, On Tue, Jan 31, 2017 at 1:29 AM, Andrea Faulds wrote: > > Christoph M. Becker wrote: > > Just a quick idea: >> >> > >> class PNRG { >> public function __construct($seed = null) {…} >> public function get() {…} >> } >> >> > I've long favoured an API along these lines. One size