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 the: " .$groups[$index%sizeOf($groups)]. "group" ; echo ($result); echo "<br>"; echo "<br>"; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
187.32 ms | 2070 KiB | 10 Q