3v4l.org

run code in 300+ 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 = 23
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 23
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: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/0anmM
function name:  (null)
number of ops:  25
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, ->23
          7    > > FE_FETCH_R                                       ~8      $7, !2, ->23
          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        INIT_FCALL                                               'trim'
         16        SEND_VAR                                                 !2
         17        SEND_VAL                                                 '%2C+'
         18        DO_ICALL                                         $13     
         19        CONCAT                                           ~14     ~12, $13
         20        CONCAT                                           ~15     ~14, '%0A'
         21        ECHO                                                     ~15
    5    22      > JMP                                                      ->7
         23    >   FE_FREE                                                  $7
    6    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.94 ms | 1012 KiB | 15 Q