Hmm... interestingly off topic.
The reason why I'm using an object as a random number generator is because it allows for polymorphism. I'm wary about directly using PHP's functions because we have both rand() and mt_rand(), both of which tie a person to specific implementations. Supposing (and just supposing, for I here Mersenne Twister is very good) that a new, better random function comes out, I won't have to replace mt_rand with whatever this new function is called.
However, the more important point is that the user can override this if need be. If we have it directly hard-coded in, there's no way to change it without patching the toolkit. If we have indirection implemented using callbacks, well, that would work, but I'd rather not (I dislike callbacks: just use a command object).
Finally, I'm actually more interested in a random string generator. My slip. There is no in-built function for that, so some userland (in reference to PHP) implementation is necessary. I'm not precisely sure which implementation it is the best (the manual's comments offer so many options), so it's probably better if we don't force something on the user (if they don't want it).
Maybe too much flexibility? I can use this method elsewhere though, so don't get too hung up on the example.
I don't really want to use a registry or globals, but I also don't want to force the client to implement a singleton.
Hmm... not precisely sure what I meant there, I think what I meant to say was I also wanted to be able to create completely new (cloned) objects, not just references to a single one.
Let's see: Feyd and Gambler for static methods, arborint for registry. Hmm...