3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'ID=62981155;IT=OV80419674-62981155_1_3;OD=15.4;|ID=62981157;IT=OV80419674-62981157_1_3;OD=3.1;|ID=62981159;IT=OV80419674-62981159_1_3;OD=8.13;|'; $result = []; foreach (explode('|', rtrim($str, '|')) as $i => $set) { foreach (explode(';', rtrim($set, ';')) as $pair) { [$k, $result[$i][$k]] = explode('=', $pair); } } echo json_encode($result, JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 37
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 37
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 35
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 35
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 35
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/a9dvd
function name:  (null)
number of ops:  44
compiled vars:  !0 = $str, !1 = $result, !2 = $set, !3 = $i, !4 = $pair, !5 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ID%3D62981155%3BIT%3DOV80419674-62981155_1_3%3BOD%3D15.4%3B%7CID%3D62981157%3BIT%3DOV80419674-62981157_1_3%3BOD%3D3.1%3B%7CID%3D62981159%3BIT%3DOV80419674-62981159_1_3%3BOD%3D8.13%3B%7C'
    5     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%7C'
          4        INIT_FCALL                                               'rtrim'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 '%7C'
          7        DO_ICALL                                         $8      
          8        SEND_VAR                                                 $8
          9        DO_ICALL                                         $9      
         10      > FE_RESET_R                                       $10     $9, ->37
         11    > > FE_FETCH_R                                       ~11     $10, !2, ->37
         12    >   ASSIGN                                                   !3, ~11
    7    13        INIT_FCALL                                               'explode'
         14        SEND_VAL                                                 '%3B'
         15        INIT_FCALL                                               'rtrim'
         16        SEND_VAR                                                 !2
         17        SEND_VAL                                                 '%3B'
         18        DO_ICALL                                         $13     
         19        SEND_VAR                                                 $13
         20        DO_ICALL                                         $14     
         21      > FE_RESET_R                                       $15     $14, ->35
         22    > > FE_FETCH_R                                               $15, !4, ->35
    8    23    >   INIT_FCALL                                               'explode'
         24        SEND_VAL                                                 '%3D'
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                         $16     
         27        FETCH_LIST_R                                     $17     $16, 0
         28        ASSIGN                                                   !5, $17
         29        FETCH_LIST_R                                     $19     $16, 1
         30        FETCH_DIM_W                                      $20     !1, !3
         31        ASSIGN_DIM                                               $20, !5
         32        OP_DATA                                                  $19
         33        FREE                                                     $16
    7    34      > JMP                                                      ->22
         35    >   FE_FREE                                                  $15
    6    36      > JMP                                                      ->11
         37    >   FE_FREE                                                  $10
   11    38        INIT_FCALL                                               'json_encode'
         39        SEND_VAR                                                 !1
         40        SEND_VAL                                                 160
         41        DO_ICALL                                         $22     
         42        ECHO                                                     $22
         43      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.88 ms | 1005 KiB | 16 Q