3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=array('Fieldname1:value;Filedname2:value;Fieldname3:value', 'Fieldname1:value;Filedname2:value;Fieldname3:value', 'Fieldname1:value;Filedname2:value;Fieldname3:value',); $arr = array(); foreach ($array as $line) { $str = explode(';', $line); foreach( $str as $strPair ) { list($key, $value) = explode(':', $strPair); $tmpArr[$key]= $value; } $arr[] = tmpArr; } var_dump($arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 28
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 23
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 23
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 23
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/SmHG5
function name:  (null)
number of ops:  33
compiled vars:  !0 = $array, !1 = $arr, !2 = $line, !3 = $str, !4 = $strPair, !5 = $key, !6 = $value, !7 = $tmpArr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $10     !0, ->28
          3    > > FE_FETCH_R                                               $10, !2, ->28
    7     4    >   INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%3B'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $11     
          8        ASSIGN                                                   !3, $11
    8     9      > FE_RESET_R                                       $13     !3, ->23
         10    > > FE_FETCH_R                                               $13, !4, ->23
    9    11    >   INIT_FCALL                                               'explode'
         12        SEND_VAL                                                 '%3A'
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $14     
         15        FETCH_LIST_R                                     $15     $14, 0
         16        ASSIGN                                                   !5, $15
         17        FETCH_LIST_R                                     $17     $14, 1
         18        ASSIGN                                                   !6, $17
         19        FREE                                                     $14
   10    20        ASSIGN_DIM                                               !7, !5
         21        OP_DATA                                                  !6
    8    22      > JMP                                                      ->10
         23    >   FE_FREE                                                  $13
   12    24        FETCH_CONSTANT                                   ~21     'tmpArr'
         25        ASSIGN_DIM                                               !1
         26        OP_DATA                                                  ~21
    6    27      > JMP                                                      ->3
         28    >   FE_FREE                                                  $10
   14    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.5 ms | 1401 KiB | 17 Q