3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '224,1,23,Pineapple,2500,2500,anana.png__240,1,23,Goavy,2500,250, goavy.png__140,1,23,Apple, 100,250,pomme.png'; $arr = explode("__", $str); Foreach($arr as $val){ $items = explode(",", $val); $res[$items[5]] = $items[3]; } print_r($res);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/WY7b7
function name:  (null)
number of ops:  23
compiled vars:  !0 = $str, !1 = $arr, !2 = $val, !3 = $items, !4 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '224%2C1%2C23%2CPineapple%2C2500%2C2500%2Canana.png__240%2C1%2C23%2CGoavy%2C2500%2C250%2C+goavy.png__140%2C1%2C23%2CApple%2C+100%2C250%2Cpomme.png'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '__'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    6     6      > FE_RESET_R                                       $8      !1, ->18
          7    > > FE_FETCH_R                                               $8, !2, ->18
    7     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%2C'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !3, $9
    8    13        FETCH_DIM_R                                      ~11     !3, 5
         14        FETCH_DIM_R                                      ~13     !3, 3
         15        ASSIGN_DIM                                               !4, ~11
         16        OP_DATA                                                  ~13
    6    17      > JMP                                                      ->7
         18    >   FE_FREE                                                  $8
   10    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !4
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.95 ms | 1395 KiB | 17 Q