The openssl_random_pseudo_bytes() function will now throw an exception in error situations, similar to random_bytes(). In particular, an Error is thrown if the number of requested bytes is less than or equal to zero, and an Exception is thrown if sufficient randomness cannot be gathered. The $crypto_strong output argument is guaranteed to always be TRUE if the function does not throw, so explicitly checking it is not necessary.
We don't have to get an $iv when $iv length equals zero.
This fixes support for php 7.4