```
$maxAtOnce = floor(log(mt_getrandmax()) / log(10));
$numbers = '';
for ($i = 0; $i < floor($nbReplacements / $maxAtOnce); $i++) $numbers .= str_pad(static::randomNumber($maxAtOnce), $maxAtOnce, '0', STR_PAD_LEFT);
$remainder = $nbReplacements % $maxAtOnce;
$numbers .= str_pad(static::randomNumber($remainder), $remainder, '0', STR_PAD_LEFT);
```
Not really nice, but it should do the trick. It's up to you.