3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'client_no=100&auth_key=stEKy9vvN9mKEPTeAdNkfeuUE5CGHknB&rest_call=create_surcharge&cat=admintools-api&surcharge_name=mysurcharge1&description=description123&ext_description=description1234&currency_cd=usd&surcharge_type_cd=F&inline_offset_ind=I&apply_b4_or_after_discount_cd=B&scope_no=1&surcharge_tier[0][from]=1&surcharge_tier[0][rate]=3&plan_no[0][plan_nos]=asd&schedule[0][schedule_name]=TestSchedule1&schedule[0][currency_cd]=usd&submit=Agree & Execute'; parse_str($string, $output); var_dump($output); $rowObjectExample = ''; foreach($output as $name => $value) { if(isset($output[$name])) { if(is_array($value)) { $i = 0; $length = count($value); foreach($value as $key=>$val) { $i++; $rowObjectExample .= $name.'_row '.$name.'Row'; if($length > 1) { $rowObjectExample .= ($i <= $length ? $key : ''); } else if(is_array($val)) { $rowObjectExample .= ($i <= count($val) ? $key : ''); } $rowObjectExample .= ' = new '.$name.'_row()'.";\n\t"; if(is_array($val)) { foreach($val as $k=>$v) { if(is_array($v)) { $n = 0; $len = count($v); foreach ($v as $row=>$column) { if(is_array($column)) { $rowObjectExample .= $k.'_row '.$k.'Row'.$row.' = new '.$k.'_row()'."\n\t"; $n++; foreach($column as $r=>$c) { $rowObjectExample .= $k.'Row'; if($len > 1) { $rowObjectExample .= ($n <= $len ? $row : ''); } $rowObjectExample .= '.'.$r.' = '; $rowObjectExample .= (empty($c) ? 'null' : $c)."\n\t"; } } } } else { $rowObjectExample .= $name.'Row'; $rowObjectExample .= ($i <= count($val) ? $key : ''); $rowObjectExample .= '.'.$k.' = '.$v."\n\t"; } } } } } } } var_dump($rowObjectExample);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 121
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 121
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 120
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 120
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 119
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 119
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 36
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 33
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 118
Branch analysis from position: 51
2 jumps found. (Code = 77) Position 1 = 52, Position 2 = 117
Branch analysis from position: 52
2 jumps found. (Code = 78) Position 1 = 53, Position 2 = 117
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 102
Branch analysis from position: 56
2 jumps found. (Code = 77) Position 1 = 60, Position 2 = 100
Branch analysis from position: 60
2 jumps found. (Code = 78) Position 1 = 61, Position 2 = 100
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 99
Branch analysis from position: 64
2 jumps found. (Code = 77) Position 1 = 75, Position 2 = 98
Branch analysis from position: 75
2 jumps found. (Code = 78) Position 1 = 76, Position 2 = 98
Branch analysis from position: 76
2 jumps found. (Code = 43) Position 1 = 81, Position 2 = 87
Branch analysis from position: 81
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 85
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
2 jumps found. (Code = 43) Position 1 = 92, Position 2 = 94
Branch analysis from position: 92
1 jumps found. (Code = 42) Position 1 = 95
Branch analysis from position: 95
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
Branch analysis from position: 94
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
Branch analysis from position: 85
2 jumps found. (Code = 43) Position 1 = 92, Position 2 = 94
Branch analysis from position: 92
Branch analysis from position: 94
Branch analysis from position: 87
Branch analysis from position: 98
1 jumps found. (Code = 42) Position 1 = 60
Branch analysis from position: 60
Branch analysis from position: 98
Branch analysis from position: 99
Branch analysis from position: 100
1 jumps found. (Code = 42) Position 1 = 116
Branch analysis from position: 116
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 100
Branch analysis from position: 102
2 jumps found. (Code = 43) Position 1 = 107, Position 2 = 109
Branch analysis from position: 107
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 109
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 117
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 117
Branch analysis from position: 118
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 45
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 118
Branch analysis from position: 51
Branch analysis from position: 118
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 51, Position 2 = 118
Branch analysis from position: 51
Branch analysis from position: 118
Branch analysis from position: 45
Branch analysis from position: 119
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 119
Branch analysis from position: 120
Branch analysis from position: 120
Branch analysis from position: 121
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 121
filename:       /in/SbTfu
function name:  (null)
number of ops:  126
compiled vars:  !0 = $string, !1 = $output, !2 = $rowObjectExample, !3 = $value, !4 = $name, !5 = $i, !6 = $length, !7 = $val, !8 = $key, !9 = $v, !10 = $k, !11 = $n, !12 = $len, !13 = $column, !14 = $row, !15 = $c, !16 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'client_no%3D100%26auth_key%3DstEKy9vvN9mKEPTeAdNkfeuUE5CGHknB%26rest_call%3Dcreate_surcharge%26cat%3Dadmintools-api%26surcharge_name%3Dmysurcharge1%26description%3Ddescription123%26ext_description%3Ddescription1234%26currency_cd%3Dusd%26surcharge_type_cd%3DF%26inline_offset_ind%3DI%26apply_b4_or_after_discount_cd%3DB%26scope_no%3D1%26surcharge_tier%5B0%5D%5Bfrom%5D%3D1%26surcharge_tier%5B0%5D%5Brate%5D%3D3%26plan_no%5B0%5D%5Bplan_nos%5D%3Dasd%26schedule%5B0%5D%5Bschedule_name%5D%3DTestSchedule1%26schedule%5B0%5D%5Bcurrency_cd%5D%3Dusd%26submit%3DAgree+%26+Execute'
    4     1        INIT_FCALL                                               'parse_str'
          2        SEND_VAR                                                 !0
          3        SEND_REF                                                 !1
          4        DO_ICALL                                                 
    5     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    6     8        ASSIGN                                                   !2, ''
    7     9      > FE_RESET_R                                       $21     !1, ->121
         10    > > FE_FETCH_R                                       ~22     $21, !3, ->121
         11    >   ASSIGN                                                   !4, ~22
    8    12        ISSET_ISEMPTY_DIM_OBJ                         0          !1, !4
         13      > JMPZ                                                     ~24, ->120
    9    14    >   TYPE_CHECK                                  128          !3
         15      > JMPZ                                                     ~25, ->120
   10    16    >   ASSIGN                                                   !5, 0
   11    17        COUNT                                            ~27     !3
         18        ASSIGN                                                   !6, ~27
   12    19      > FE_RESET_R                                       $29     !3, ->119
         20    > > FE_FETCH_R                                       ~30     $29, !7, ->119
         21    >   ASSIGN                                                   !8, ~30
   13    22        PRE_INC                                                  !5
   14    23        CONCAT                                           ~33     !4, '_row+'
         24        CONCAT                                           ~34     ~33, !4
         25        CONCAT                                           ~35     ~34, 'Row'
         26        ASSIGN_OP                                     8          !2, ~35
   15    27        IS_SMALLER                                               1, !6
         28      > JMPZ                                                     ~37, ->36
   16    29    >   IS_SMALLER_OR_EQUAL                                      !5, !6
         30      > JMPZ                                                     ~38, ->33
         31    >   QM_ASSIGN                                        ~39     !8
         32      > JMP                                                      ->34
         33    >   QM_ASSIGN                                        ~39     ''
         34    >   ASSIGN_OP                                     8          !2, ~39
         35      > JMP                                                      ->45
   17    36    >   TYPE_CHECK                                  128          !7
         37      > JMPZ                                                     ~41, ->45
   18    38    >   COUNT                                            ~42     !7
         39        IS_SMALLER_OR_EQUAL                                      !5, ~42
         40      > JMPZ                                                     ~43, ->43
         41    >   QM_ASSIGN                                        ~44     !8
         42      > JMP                                                      ->44
         43    >   QM_ASSIGN                                        ~44     ''
         44    >   ASSIGN_OP                                     8          !2, ~44
   20    45    >   CONCAT                                           ~46     '+%3D+new+', !4
         46        CONCAT                                           ~47     ~46, '_row%28%29'
         47        CONCAT                                           ~48     ~47, '%3B%0A%09'
         48        ASSIGN_OP                                     8          !2, ~48
   21    49        TYPE_CHECK                                  128          !7
         50      > JMPZ                                                     ~50, ->118
   22    51    > > FE_RESET_R                                       $51     !7, ->117
         52    > > FE_FETCH_R                                       ~52     $51, !9, ->117
         53    >   ASSIGN                                                   !10, ~52
   23    54        TYPE_CHECK                                  128          !9
         55      > JMPZ                                                     ~54, ->102
   24    56    >   ASSIGN                                                   !11, 0
   25    57        COUNT                                            ~56     !9
         58        ASSIGN                                                   !12, ~56
   26    59      > FE_RESET_R                                       $58     !9, ->100
         60    > > FE_FETCH_R                                       ~59     $58, !13, ->100
         61    >   ASSIGN                                                   !14, ~59
   27    62        TYPE_CHECK                                  128          !13
         63      > JMPZ                                                     ~61, ->99
   28    64    >   CONCAT                                           ~62     !10, '_row+'
         65        CONCAT                                           ~63     ~62, !10
         66        CONCAT                                           ~64     ~63, 'Row'
         67        CONCAT                                           ~65     ~64, !14
         68        CONCAT                                           ~66     ~65, '+%3D+new+'
         69        CONCAT                                           ~67     ~66, !10
         70        CONCAT                                           ~68     ~67, '_row%28%29'
         71        CONCAT                                           ~69     ~68, '%0A%09'
         72        ASSIGN_OP                                     8          !2, ~69
   29    73        PRE_INC                                                  !11
   30    74      > FE_RESET_R                                       $72     !13, ->98
         75    > > FE_FETCH_R                                       ~73     $72, !15, ->98
         76    >   ASSIGN                                                   !16, ~73
   31    77        CONCAT                                           ~75     !10, 'Row'
         78        ASSIGN_OP                                     8          !2, ~75
   32    79        IS_SMALLER                                               1, !12
         80      > JMPZ                                                     ~77, ->87
   33    81    >   IS_SMALLER_OR_EQUAL                                      !11, !12
         82      > JMPZ                                                     ~78, ->85
         83    >   QM_ASSIGN                                        ~79     !14
         84      > JMP                                                      ->86
         85    >   QM_ASSIGN                                        ~79     ''
         86    >   ASSIGN_OP                                     8          !2, ~79
   35    87    >   CONCAT                                           ~81     '.', !16
         88        CONCAT                                           ~82     ~81, '+%3D+'
         89        ASSIGN_OP                                     8          !2, ~82
   36    90        ISSET_ISEMPTY_CV                                         !15
         91      > JMPZ                                                     ~84, ->94
         92    >   QM_ASSIGN                                        ~85     'null'
         93      > JMP                                                      ->95
         94    >   QM_ASSIGN                                        ~85     !15
         95    >   CONCAT                                           ~86     ~85, '%0A%09'
         96        ASSIGN_OP                                     8          !2, ~86
   30    97      > JMP                                                      ->75
         98    >   FE_FREE                                                  $72
   26    99    > > JMP                                                      ->60
        100    >   FE_FREE                                                  $58
        101      > JMP                                                      ->116
   41   102    >   CONCAT                                           ~88     !4, 'Row'
        103        ASSIGN_OP                                     8          !2, ~88
   42   104        COUNT                                            ~90     !7
        105        IS_SMALLER_OR_EQUAL                                      !5, ~90
        106      > JMPZ                                                     ~91, ->109
        107    >   QM_ASSIGN                                        ~92     !8
        108      > JMP                                                      ->110
        109    >   QM_ASSIGN                                        ~92     ''
        110    >   ASSIGN_OP                                     8          !2, ~92
   43   111        CONCAT                                           ~94     '.', !10
        112        CONCAT                                           ~95     ~94, '+%3D+'
        113        CONCAT                                           ~96     ~95, !9
        114        CONCAT                                           ~97     ~96, '%0A%09'
        115        ASSIGN_OP                                     8          !2, ~97
   22   116    > > JMP                                                      ->52
        117    >   FE_FREE                                                  $51
   12   118    > > JMP                                                      ->20
        119    >   FE_FREE                                                  $29
    7   120    > > JMP                                                      ->10
        121    >   FE_FREE                                                  $21
   52   122        INIT_FCALL                                               'var_dump'
        123        SEND_VAR                                                 !2
        124        DO_ICALL                                                 
        125      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.67 ms | 1412 KiB | 17 Q