3v4l.org

run code in 500+ 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 = 28
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 28
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 22
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/S8hKW
function name:  (null)
number of ops:  34
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, ->28
          9    > > FE_FETCH_R                                           ~11     $10, !3, ->28
         10    >   ASSIGN                                                       !4, ~11
    9    11        FETCH_DIM_R                                          ~13     !3, 0
         12        IS_EQUAL                                                     ~13, '%7C'
         13      > JMPZ                                                         ~14, ->22
   10    14    >   PRE_INC                                                      !2
   11    15        FRAMELESS_ICALL_2                substr              ~17     !3, 1
         16        FETCH_DIM_R                                          ~19     !1, 2
         17        FETCH_DIM_R                                          ~20     ~19, !4
         18        FETCH_DIM_W                                          $16     !5, !2
         19        ASSIGN_DIM                                                   $16, ~17
         20        OP_DATA                                                      ~20
    9    21      > JMP                                                          ->27
   13    22    >   FETCH_DIM_R                                          ~23     !1, 2
         23        FETCH_DIM_R                                          ~24     ~23, !4
         24        FETCH_DIM_W                                          $21     !5, !2
         25        ASSIGN_DIM                                                   $21, !3
         26        OP_DATA                                                      ~24
    8    27    > > JMP                                                          ->9
         28    >   FE_FREE                                                      $10
   16    29        INIT_FCALL                                                   'json_encode'
         30        SEND_VAR                                                     !5
         31        DO_ICALL                                             $25     
         32        ECHO                                                         $25
         33      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.59 ms | 2075 KiB | 15 Q