3v4l.org

run code in 300+ PHP versions simultaneously
<?php $names = [ 'John', 'Jane', 'George', 'Jim', 'Jack' ]; $groups = [ '1', '2', '3' ]; foreach ($names as $index => $name) { $result = "The student: " . $name . " belongs to group " .$groups[$index % count($groups)]. ".\n"; echo $result; }
Output for git.master, git.master_jit, rfc.property-hooks
The student: John belongs to group 1. The student: Jane belongs to group 2. The student: George belongs to group 3. The student: Jim belongs to group 1. The student: Jack belongs to group 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:
27.9 ms | 405 KiB | 5 Q