3v4l.org

run code in 500+ PHP versions simultaneously
<?php $str = "Munich, Germany, Berlin, Germany, London, UK, Paris, France, Vienna, Austria, Milano, Italy, Rome, Italy"; $array = explode(",",$str); foreach($array as $k => $value){ if($k % 2){ $country_list[] = trim($value); }else{ $city_list[] = trim($value); } } print_r(join(",",$city_list)); print_r(PHP_EOL); print_r(join(",",$country_list));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
filename:       /in/Vh6X5
function name:  (null)
number of ops:  38
compiled vars:  !0 = $str, !1 = $array, !2 = $value, !3 = $k, !4 = $country_list, !5 = $city_list
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Munich%2C+Germany%2C+Berlin%2C+Germany%2C+London%2C+UK%2C+Paris%2C+France%2C+Vienna%2C+Austria%2C+Milano%2C+Italy%2C+Rome%2C+Italy'
    4     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '%2C'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $7      
          5        ASSIGN                                                       !1, $7
    5     6      > FE_RESET_R                                           $9      !1, ->19
          7    > > FE_FETCH_R                                           ~10     $9, !2, ->19
          8    >   ASSIGN                                                       !3, ~10
    6     9        MOD                                                  ~12     !3, 2
         10      > JMPZ                                                         ~12, ->15
    7    11    >   FRAMELESS_ICALL_1                trim                ~14     !2
         12        ASSIGN_DIM                                                   !4
         13        OP_DATA                                                      ~14
    6    14      > JMP                                                          ->18
    9    15    >   FRAMELESS_ICALL_1                trim                ~16     !2
         16        ASSIGN_DIM                                                   !5
         17        OP_DATA                                                      ~16
    5    18    > > JMP                                                          ->7
         19    >   FE_FREE                                                      $9
   13    20        INIT_FCALL                                                   'print_r'
         21        INIT_FCALL                                                   'join'
         22        SEND_VAL                                                     '%2C'
         23        SEND_VAR                                                     !5
         24        DO_ICALL                                             $17     
         25        SEND_VAR                                                     $17
         26        DO_ICALL                                                     
   14    27        INIT_FCALL                                                   'print_r'
         28        SEND_VAL                                                     '%0A'
         29        DO_ICALL                                                     
   15    30        INIT_FCALL                                                   'print_r'
         31        INIT_FCALL                                                   'join'
         32        SEND_VAL                                                     '%2C'
         33        SEND_VAR                                                     !4
         34        DO_ICALL                                             $20     
         35        SEND_VAR                                                     $20
         36        DO_ICALL                                                     
         37      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.16 ms | 2104 KiB | 18 Q