3v4l.org

run code in 300+ PHP versions simultaneously
<?php function chargement($nbre, $nbreParChargement){ $niveaux = array_fill(0, floor($nbre/$nbreParChargement), $nbreParChargement); $niveaux[] = $nbre - array_sum($niveaux); return $niveaux; } var_dump(chargement(10, 4)); var_dump(chargement(14, 6)); var_dump(chargement(13, 16)); var_dump(chargement(30, 4));
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> int(4) [1]=> int(4) [2]=> int(2) } array(3) { [0]=> int(6) [1]=> int(6) [2]=> int(2) } array(1) { [0]=> int(13) } array(8) { [0]=> int(4) [1]=> int(4) [2]=> int(4) [3]=> int(4) [4]=> int(4) [5]=> int(4) [6]=> int(4) [7]=> int(2) }

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:
152.3 ms | 406 KiB | 5 Q