Hi!

> Something like this, maybe:
> 
>     $numgen = new RandomNumberGenerator(RAND_MERSENNE_TWISTER, time()); // 
> could auto-seed with time()
>     $randInt1 = $numgen->getInt(0, 100); // gets random integer and advances 
> this generator
>     list($randInt2, $numgen) = $numgen->newGetInt(0, 100); // gets random 
> integer and returns a new, advanced generator
>     $serialised = $numgen->serialiseState(); // Or maybe $numgen->getSeed() ?
> 
> Does that work?

Having new, better API is fine. Breaking existing working code because
new, better API is possible, is not fine.

-- 
Stas Malyshev
smalys...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to