3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = "Football / Germany / 1.Liga Football / Germany / 1.Liga Football / Germany / 2.Liga Football / Germany / 2.Liga Football / Germany / 2.Liga Football / England / 1.Liga Football / England / 1.Liga Football / England / 2.Liga Football / England / 2.Liga Football / England / 3.Liga Hockey / Germany / 1.Liga Hockey / Germany / 1.Liga Hockey / Germany / 2.Liga Fechten / Meisterschaft Fechten / Meisterschaft Fechten / Weltmeister"; $lines = explode("\n", $strings); $array = array(); foreach($lines as $line) { $values = explode(' / ', $line); $depth = 0; foreach($values as $value) { if(!in_array($value, $array[$depth])) $array[$depth][] = $value; $depth++; } } var_dump($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 31
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 31
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 29
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 29
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 27
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 29
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/eseQK
function name:  (null)
number of ops:  36
compiled vars:  !0 = $strings, !1 = $lines, !2 = $array, !3 = $line, !4 = $values, !5 = $depth, !6 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Football+%2F+Germany+%2F+1.Liga%0AFootball+%2F+Germany+%2F+1.Liga%0AFootball+%2F+Germany+%2F+2.Liga%0AFootball+%2F+Germany+%2F+2.Liga%0AFootball+%2F+Germany+%2F+2.Liga%0AFootball+%2F+England+%2F+1.Liga%0AFootball+%2F+England+%2F+1.Liga%0AFootball+%2F+England+%2F+2.Liga%0AFootball+%2F+England+%2F+2.Liga%0AFootball+%2F+England+%2F+3.Liga%0AHockey+%2F+Germany+%2F+1.Liga%0AHockey+%2F+Germany+%2F+1.Liga%0AHockey+%2F+Germany+%2F+2.Liga%0AFechten+%2F+Meisterschaft%0AFechten+%2F+Meisterschaft%0AFechten+%2F+Weltmeister'
   19     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
   20     6        ASSIGN                                                   !2, <array>
   22     7      > FE_RESET_R                                       $11     !1, ->31
          8    > > FE_FETCH_R                                               $11, !3, ->31
   23     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '+%2F+'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !4, $12
   25    14        ASSIGN                                                   !5, 0
   26    15      > FE_RESET_R                                       $15     !4, ->29
         16    > > FE_FETCH_R                                               $15, !6, ->29
   27    17    >   INIT_FCALL                                               'in_array'
         18        SEND_VAR                                                 !6
         19        FETCH_DIM_R                                      ~16     !2, !5
         20        SEND_VAL                                                 ~16
         21        DO_ICALL                                         $17     
         22        BOOL_NOT                                         ~18     $17
         23      > JMPZ                                                     ~18, ->27
         24    >   FETCH_DIM_W                                      $19     !2, !5
         25        ASSIGN_DIM                                               $19
         26        OP_DATA                                                  !6
   28    27    >   PRE_INC                                                  !5
   26    28      > JMP                                                      ->16
         29    >   FE_FREE                                                  $15
   22    30      > JMP                                                      ->8
         31    >   FE_FREE                                                  $11
   32    32        INIT_FCALL                                               'var_dump'
         33        SEND_VAR                                                 !2
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.56 ms | 1400 KiB | 19 Q