23 if (isset($DIC[
'ilLoggerFactory'])) {
24 $c($DIC->logger()->rnd());
34 public function int($min = null, $max = null)
40 $max = mt_getrandmax();
45 return random_int($min, $max);
49 $logger->
error(
'No suitable random number generator found.');
55 $logger->
error(
'max should be greater than min.');
61 return mt_rand($min, $max);
69 if (version_compare(PHP_VERSION,
'7.0.0',
'>=')) {
int($min=null, $max=null)
__construct()
ilRandom constructor.
logStack($a_level=null, $a_message='')
log stack trace
logIfPossible(callable $c)
Wrapper for generation of random numbers, strings, bytes.
Component logger with individual log levels by component id.