3v4l.org

run code in 300+ 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 = 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 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 17
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/Vh6X5
function name:  (null)
number of ops:  42
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, ->23
          7    > > FE_FETCH_R                                       ~10     $9, !2, ->23
          8    >   ASSIGN                                                   !3, ~10
    6     9        MOD                                              ~12     !3, 2
         10      > JMPZ                                                     ~12, ->17
    7    11    >   INIT_FCALL                                               'trim'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $14     
         14        ASSIGN_DIM                                               !4
         15        OP_DATA                                                  $14
    6    16      > JMP                                                      ->22
    9    17    >   INIT_FCALL                                               'trim'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $16     
         20        ASSIGN_DIM                                               !5
         21        OP_DATA                                                  $16
    5    22    > > JMP                                                      ->7
         23    >   FE_FREE                                                  $9
   13    24        INIT_FCALL                                               'print_r'
         25        INIT_FCALL                                               'join'
         26        SEND_VAL                                                 '%2C'
         27        SEND_VAR                                                 !5
         28        DO_ICALL                                         $17     
         29        SEND_VAR                                                 $17
         30        DO_ICALL                                                 
   14    31        INIT_FCALL                                               'print_r'
         32        SEND_VAL                                                 '%0A'
         33        DO_ICALL                                                 
   15    34        INIT_FCALL                                               'print_r'
         35        INIT_FCALL                                               'join'
         36        SEND_VAL                                                 '%2C'
         37        SEND_VAR                                                 !4
         38        DO_ICALL                                         $20     
         39        SEND_VAR                                                 $20
         40        DO_ICALL                                                 
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
261.75 ms | 1010 KiB | 17 Q