Use random_bytes() if it's available. The entire purpose of the random_* functions is to be the simple, easy choice so you don't have to try to work out yourself which of the myriad of random generation methods in PHP to use. If a better method of generating random numbers is found than the current method random_bytes() uses, random_bytes() will be updated to use that method.

For older versions of PHP, use random_compat, which will pick the best available method.