- var_dump: documentation ( source)
- unpack: documentation ( source)
<?php
$current = null;
$count = 0;
while ($current !== 0) {
$count++;
$bytes = openssl_random_pseudo_bytes(2);
$current = unpack("S", $bytes);
var_dump($current);
}
var_dump($count);