3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array ( 0 => '2,2-0-tc', 1 => '2-0', 2 => '2-0-tc', 3 => '3,3-0-sc-v6', 4 => '3-0-sc-v6', 5 => '3-0sc-v6', 6 => '5-0-sc-v8' ); $newArr = []; foreach($arr as $key=>$val){ $temp = explode (',', $val); foreach($temp as $new){ $newArr[$new] = $val; } } print_r($newArr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 15
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/3cVPP
function name:  (null)
number of ops:  22
compiled vars:  !0 = $arr, !1 = $newArr, !2 = $val, !3 = $key, !4 = $temp, !5 = $new
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, <array>
   15     2      > FE_RESET_R                                       $8      !0, ->17
          3    > > FE_FETCH_R                                       ~9      $8, !2, ->17
          4    >   ASSIGN                                                   !3, ~9
   16     5        INIT_FCALL                                               'explode'
          6        SEND_VAL                                                 '%2C'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $11     
          9        ASSIGN                                                   !4, $11
   17    10      > FE_RESET_R                                       $13     !4, ->15
         11    > > FE_FETCH_R                                               $13, !5, ->15
   18    12    >   ASSIGN_DIM                                               !1, !5
         13        OP_DATA                                                  !2
   17    14      > JMP                                                      ->11
         15    >   FE_FREE                                                  $13
   15    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $8
   21    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.68 ms | 1395 KiB | 17 Q