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; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/LmYRk
function name:  (null)
number of ops:  17
compiled vars:  !0 = $names, !1 = $groups, !2 = $name, !3 = $index, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   11     1        ASSIGN                                                   !1, <array>
   17     2      > FE_RESET_R                                       $7      !0, ->15
          3    > > FE_FETCH_R                                       ~8      $7, !2, ->15
          4    >   ASSIGN                                                   !3, ~8
   18     5        CONCAT                                           ~10     'The+student%3A+', !2
          6        CONCAT                                           ~11     ~10, '+belongs+to+group+'
          7        COUNT                                            ~12     !1
          8        MOD                                              ~13     !3, ~12
          9        FETCH_DIM_R                                      ~14     !1, ~13
         10        CONCAT                                           ~15     ~11, ~14
         11        CONCAT                                           ~16     ~15, '.%0A'
         12        ASSIGN                                                   !4, ~16
   19    13        ECHO                                                     !4
   17    14      > JMP                                                      ->3
         15    >   FE_FREE                                                  $7
   20    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.91 ms | 1423 KiB | 13 Q