- var_dump: documentation ( source)
- round: documentation ( source)
- floor: documentation ( source)
- ini_set: documentation ( source)
- printf: documentation ( source)
<?php
ini_set("precision", 20);
// from 246
$from = "8.2" * "30";
// to 342
$to = "11.4" * "30";
printf("from %.20f to %.20f\n", $from, $to);
$a = [];
for ($i = $from; $i <= $to; $i++) {
if (round($i) != floor($i)) {
printf("index %.20f will be truncated to %d\n", $i, $i);
}
if ($i == 246) {
echo "No output at all!";
}
if ($i == 250) {
echo "Still no output...";
}
if ($i == 256) {
echo "Still no output...";
}
if ($i == 257) {
echo "It works for {$i} and further numbers";
}
$a[$i] = "test" . $i;
}
var_dump($a);