3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getBatchSize(int $totalRecordsCount) : int { $batchSize = (int) ceil($totalRecordsCount / 5000); $roundDivisor = pow(10, strlen((string) $batchSize) - 1); $batchSize = (int) ceil($batchSize / $roundDivisor) * $roundDivisor; return max( 10, min(100, $batchSize) ); } var_dump(getBatchSize(5), '---'); var_dump(getBatchSize(17), '---'); var_dump(getBatchSize(173), '---'); var_dump(getBatchSize(212522), '---'); var_dump(getBatchSize(2125223), '---');
Output for git.master, git.master_jit, rfc.property-hooks
int(10) string(3) "---" int(10) string(3) "---" int(10) string(3) "---" int(50) string(3) "---" int(100) string(3) "---"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
55.11 ms | 401 KiB | 8 Q