28 if (isset($DIC[
'ilLoggerFactory'])) {
29 $c($DIC->logger()->rnd());
39 public function int($min = null, $max = null)
45 $max = mt_getrandmax();
50 return random_int($min, $max);
54 $logger->
error(
'No suitable random number generator found.');
60 $logger->
error(
'max should be greater than min.');
66 return mt_rand($min, $max);
74 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.