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;|'; preg_match_all("/(.*?)\=(.*?);/", $str, $match); //var_dump($match); $i = 0; foreach($match[1] as $key => $m){ if($m[0] == "|"){ $i++; $u[$i][substr($m,1)] = $match[2][$key]; }else{ $u[$i][$m] = $match[2][$key]; } } echo json_encode($u);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 31
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 31
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 25
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/S8hKW
function name:  (null)
number of ops:  37
compiled vars:  !0 = $str, !1 = $match, !2 = $i, !3 = $m, !4 = $key, !5 = $u
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        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%28.%2A%3F%29%5C%3D%28.%2A%3F%29%3B%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    7     6        ASSIGN                                                   !2, 0
    8     7        FETCH_DIM_R                                      ~9      !1, 1
          8      > FE_RESET_R                                       $10     ~9, ->31
          9    > > FE_FETCH_R                                       ~11     $10, !3, ->31
         10    >   ASSIGN                                                   !4, ~11
    9    11        FETCH_DIM_R                                      ~13     !3, 0
         12        IS_EQUAL                                                 ~13, '%7C'
         13      > JMPZ                                                     ~14, ->25
   10    14    >   PRE_INC                                                  !2
   11    15        INIT_FCALL                                               'substr'
         16        SEND_VAR                                                 !3
         17        SEND_VAL                                                 1
         18        DO_ICALL                                         $17     
         19        FETCH_DIM_R                                      ~19     !1, 2
         20        FETCH_DIM_R                                      ~20     ~19, !4
         21        FETCH_DIM_W                                      $16     !5, !2
         22        ASSIGN_DIM                                               $16, $17
         23        OP_DATA                                                  ~20
    9    24      > JMP                                                      ->30
   13    25    >   FETCH_DIM_R                                      ~23     !1, 2
         26        FETCH_DIM_R                                      ~24     ~23, !4
         27        FETCH_DIM_W                                      $21     !5, !2
         28        ASSIGN_DIM                                               $21, !3
         29        OP_DATA                                                  ~24
    8    30    > > JMP                                                      ->9
         31    >   FE_FREE                                                  $10
   16    32        INIT_FCALL                                               'json_encode'
         33        SEND_VAR                                                 !5
         34        DO_ICALL                                         $25     
         35        ECHO                                                     $25
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.25 ms | 1005 KiB | 16 Q