3v4l.org

run code in 500+ PHP versions simultaneously
<?php $input = 'Jrew Low, Bill Wilt, Law Naw, Ing Holp'; $chunks = explode(" ", $input); foreach($chunks as $index=>$name) echo ($index % 2 ? "Last" : "First") . " name: ".trim($name, ", ")."\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 20
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/0anmM
function name:  (null)
number of ops:  22
compiled vars:  !0 = $input, !1 = $chunks, !2 = $name, !3 = $index
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Jrew+Low%2C+Bill+Wilt%2C+Law+Naw%2C+Ing+Holp'
    4     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '+'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $5      
          5        ASSIGN                                                       !1, $5
    5     6      > FE_RESET_R                                           $7      !1, ->20
          7    > > FE_FETCH_R                                           ~8      $7, !2, ->20
          8    >   ASSIGN                                                       !3, ~8
    6     9        MOD                                                  ~10     !3, 2
         10      > JMPZ                                                         ~10, ->13
         11    >   QM_ASSIGN                                            ~11     'Last'
         12      > JMP                                                          ->14
         13    >   QM_ASSIGN                                            ~11     'First'
         14    >   CONCAT                                               ~12     ~11, '+name%3A+'
         15        FRAMELESS_ICALL_2                trim                ~13     !2, '%2C+'
         16        CONCAT                                               ~14     ~12, ~13
         17        CONCAT                                               ~15     ~14, '%0A'
         18        ECHO                                                         ~15
    5    19      > JMP                                                          ->7
         20    >   FE_FREE                                                      $7
    6    21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
130.85 ms | 2128 KiB | 14 Q