3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "client_sku=item1&service[0][name]=Relay&service[0][service_type]=RS&service[0][tier][0][from]=1&service[0][tier][0][to]=10&service[0][tier][1][from]=11&service[0][tier][1][to]="; parse_str($str, $output); $index = 0; foreach($output as $key => $row) { if(is_array($row)) { echo 'com.aria.common.shared.{{ parameter.nameUpper }}Row {{ parameter.nameCamel }}Row'.$index.' = new com.aria.common.shared.{{ parameter.nameUpper }}Row();'."\n"; if(is_array($row)) { foreach($row as $k=>$v) { if(is_array($v)) { $count = 0; $len = count($v); foreach($v as $row=>$column) { if(is_array($column)) { echo 'com.aria.common.shared.admin.'.ucfirst($row).'Array '.$row.'Array = new com.aria.common.shared.admin.'.ucfirst($row).'Array();'."\n"; foreach($column as $r=>$c) { if(is_array($c)) { echo 'com.aria.common.shared.admin.'.ucfirst($row).'Row '.$row.'Row'.$count.' = new com.aria.common.shared.admin.TierRow();'."\n"; foreach($c as $name=>$value) { echo $row.'Row'.$count.'.set'.ucfirst($name).'('.$value.');'."\n"; } } $count++; } if($count == $len - 1) { echo '{{ parameter.nameCamel }}Row'.$index.'.set'.ucfirst($row).'('.$row.'Array);'."\n"; echo '{{parameter.nameCamel }}Array.get{{ parameter.nameUpper }}Row().add({{ parameter.nameCamel }}Row'.$index.');'."\n"; } } else { echo '{{ parameter.nameUpper }}Row'.$index.'.set'.ucfirst($row).'("'.$column.'");'."\n"; } } } else { echo '{{ parameter.nameCamel }}'.$index.'set'.ucfirst($k).'("'.$v.'");'."\n"; } } } $index++; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 128
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 128
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 127
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 126
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 125
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 125
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 113
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 26, Position 2 = 111
Branch analysis from position: 26
2 jumps found. (Code = 78) Position 1 = 27, Position 2 = 111
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 99
Branch analysis from position: 30
2 jumps found. (Code = 77) Position 1 = 45, Position 2 = 79
Branch analysis from position: 45
2 jumps found. (Code = 78) Position 1 = 46, Position 2 = 79
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 77
Branch analysis from position: 49
2 jumps found. (Code = 77) Position 1 = 61, Position 2 = 76
Branch analysis from position: 61
2 jumps found. (Code = 78) Position 1 = 62, Position 2 = 76
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 61
Branch analysis from position: 61
Branch analysis from position: 76
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 76
Branch analysis from position: 77
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 98
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 98
Branch analysis from position: 79
Branch analysis from position: 99
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
Branch analysis from position: 111
1 jumps found. (Code = 42) Position 1 = 124
Branch analysis from position: 124
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 111
Branch analysis from position: 113
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 125
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 125
Branch analysis from position: 126
Branch analysis from position: 127
Branch analysis from position: 128
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 128
filename:       /in/q6cXs
function name:  (null)
number of ops:  130
compiled vars:  !0 = $str, !1 = $output, !2 = $index, !3 = $row, !4 = $key, !5 = $v, !6 = $k, !7 = $count, !8 = $len, !9 = $column, !10 = $c, !11 = $r, !12 = $value, !13 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'client_sku%3Ditem1%26service%5B0%5D%5Bname%5D%3DRelay%26service%5B0%5D%5Bservice_type%5D%3DRS%26service%5B0%5D%5Btier%5D%5B0%5D%5Bfrom%5D%3D1%26service%5B0%5D%5Btier%5D%5B0%5D%5Bto%5D%3D10%26service%5B0%5D%5Btier%5D%5B1%5D%5Bfrom%5D%3D11%26service%5B0%5D%5Btier%5D%5B1%5D%5Bto%5D%3D'
    3     1        INIT_FCALL                                               'parse_str'
          2        SEND_VAR                                                 !0
          3        SEND_REF                                                 !1
          4        DO_ICALL                                                 
    5     5        ASSIGN                                                   !2, 0
    6     6      > FE_RESET_R                                       $17     !1, ->128
          7    > > FE_FETCH_R                                       ~18     $17, !3, ->128
          8    >   ASSIGN                                                   !4, ~18
    7     9        TYPE_CHECK                                  128          !3
         10      > JMPZ                                                     ~20, ->127
    8    11    >   CONCAT                                           ~21     'com.aria.common.shared.%7B%7B+parameter.nameUpper+%7D%7DRow+%7B%7B+parameter.nameCamel+%7D%7DRow', !2
         12        CONCAT                                           ~22     ~21, '+%3D+new+com.aria.common.shared.%7B%7B+parameter.nameUpper+%7D%7DRow%28%29%3B'
         13        CONCAT                                           ~23     ~22, '%0A'
         14        ECHO                                                     ~23
    9    15        TYPE_CHECK                                  128          !3
         16      > JMPZ                                                     ~24, ->126
   10    17    > > FE_RESET_R                                       $25     !3, ->125
         18    > > FE_FETCH_R                                       ~26     $25, !5, ->125
         19    >   ASSIGN                                                   !6, ~26
   11    20        TYPE_CHECK                                  128          !5
         21      > JMPZ                                                     ~28, ->113
   12    22    >   ASSIGN                                                   !7, 0
   13    23        COUNT                                            ~30     !5
         24        ASSIGN                                                   !8, ~30
   14    25      > FE_RESET_R                                       $32     !5, ->111
         26    > > FE_FETCH_R                                       ~33     $32, !9, ->111
         27    >   ASSIGN                                                   !3, ~33
   15    28        TYPE_CHECK                                  128          !9
         29      > JMPZ                                                     ~35, ->99
   16    30    >   INIT_FCALL                                               'ucfirst'
         31        SEND_VAR                                                 !3
         32        DO_ICALL                                         $36     
         33        CONCAT                                           ~37     'com.aria.common.shared.admin.', $36
         34        CONCAT                                           ~38     ~37, 'Array+'
         35        CONCAT                                           ~39     ~38, !3
         36        CONCAT                                           ~40     ~39, 'Array+%3D+new+com.aria.common.shared.admin.'
         37        INIT_FCALL                                               'ucfirst'
         38        SEND_VAR                                                 !3
         39        DO_ICALL                                         $41     
         40        CONCAT                                           ~42     ~40, $41
         41        CONCAT                                           ~43     ~42, 'Array%28%29%3B'
         42        CONCAT                                           ~44     ~43, '%0A'
         43        ECHO                                                     ~44
   17    44      > FE_RESET_R                                       $45     !9, ->79
         45    > > FE_FETCH_R                                       ~46     $45, !10, ->79
         46    >   ASSIGN                                                   !11, ~46
   18    47        TYPE_CHECK                                  128          !10
         48      > JMPZ                                                     ~48, ->77
   19    49    >   INIT_FCALL                                               'ucfirst'
         50        SEND_VAR                                                 !3
         51        DO_ICALL                                         $49     
         52        CONCAT                                           ~50     'com.aria.common.shared.admin.', $49
         53        CONCAT                                           ~51     ~50, 'Row+'
         54        CONCAT                                           ~52     ~51, !3
         55        CONCAT                                           ~53     ~52, 'Row'
         56        CONCAT                                           ~54     ~53, !7
         57        CONCAT                                           ~55     ~54, '+%3D+new+com.aria.common.shared.admin.TierRow%28%29%3B'
         58        CONCAT                                           ~56     ~55, '%0A'
         59        ECHO                                                     ~56
   20    60      > FE_RESET_R                                       $57     !10, ->76
         61    > > FE_FETCH_R                                       ~58     $57, !12, ->76
         62    >   ASSIGN                                                   !13, ~58
   21    63        CONCAT                                           ~60     !3, 'Row'
         64        CONCAT                                           ~61     ~60, !7
         65        CONCAT                                           ~62     ~61, '.set'
         66        INIT_FCALL                                               'ucfirst'
         67        SEND_VAR                                                 !13
         68        DO_ICALL                                         $63     
         69        CONCAT                                           ~64     ~62, $63
         70        CONCAT                                           ~65     ~64, '%28'
         71        CONCAT                                           ~66     ~65, !12
         72        CONCAT                                           ~67     ~66, '%29%3B'
         73        CONCAT                                           ~68     ~67, '%0A'
         74        ECHO                                                     ~68
   20    75      > JMP                                                      ->61
         76    >   FE_FREE                                                  $57
   24    77    >   PRE_INC                                                  !7
   17    78      > JMP                                                      ->45
         79    >   FE_FREE                                                  $45
   26    80        SUB                                              ~70     !8, 1
         81        IS_EQUAL                                                 !7, ~70
         82      > JMPZ                                                     ~71, ->98
   27    83    >   CONCAT                                           ~72     '%7B%7B+parameter.nameCamel+%7D%7DRow', !2
         84        CONCAT                                           ~73     ~72, '.set'
         85        INIT_FCALL                                               'ucfirst'
         86        SEND_VAR                                                 !3
         87        DO_ICALL                                         $74     
         88        CONCAT                                           ~75     ~73, $74
         89        CONCAT                                           ~76     ~75, '%28'
         90        CONCAT                                           ~77     ~76, !3
         91        CONCAT                                           ~78     ~77, 'Array%29%3B'
         92        CONCAT                                           ~79     ~78, '%0A'
         93        ECHO                                                     ~79
   28    94        CONCAT                                           ~80     '%7B%7Bparameter.nameCamel+%7D%7DArray.get%7B%7B+parameter.nameUpper+%7D%7DRow%28%29.add%28%7B%7B+parameter.nameCamel+%7D%7DRow', !2
         95        CONCAT                                           ~81     ~80, '%29%3B'
         96        CONCAT                                           ~82     ~81, '%0A'
         97        ECHO                                                     ~82
         98    > > JMP                                                      ->110
   32    99    >   CONCAT                                           ~83     '%7B%7B+parameter.nameUpper+%7D%7DRow', !2
        100        CONCAT                                           ~84     ~83, '.set'
        101        INIT_FCALL                                               'ucfirst'
        102        SEND_VAR                                                 !3
        103        DO_ICALL                                         $85     
        104        CONCAT                                           ~86     ~84, $85
        105        CONCAT                                           ~87     ~86, '%28%22'
        106        CONCAT                                           ~88     ~87, !9
        107        CONCAT                                           ~89     ~88, '%22%29%3B'
        108        CONCAT                                           ~90     ~89, '%0A'
        109        ECHO                                                     ~90
   14   110    > > JMP                                                      ->26
        111    >   FE_FREE                                                  $32
        112      > JMP                                                      ->124
   37   113    >   CONCAT                                           ~91     '%7B%7B+parameter.nameCamel+%7D%7D', !2
        114        CONCAT                                           ~92     ~91, 'set'
        115        INIT_FCALL                                               'ucfirst'
        116        SEND_VAR                                                 !6
        117        DO_ICALL                                         $93     
        118        CONCAT                                           ~94     ~92, $93
        119        CONCAT                                           ~95     ~94, '%28%22'
        120        CONCAT                                           ~96     ~95, !5
        121        CONCAT                                           ~97     ~96, '%22%29%3B'
        122        CONCAT                                           ~98     ~97, '%0A'
        123        ECHO                                                     ~98
   10   124    > > JMP                                                      ->18
        125    >   FE_FREE                                                  $25
   41   126    >   PRE_INC                                                  !2
    6   127    > > JMP                                                      ->7
        128    >   FE_FREE                                                  $17
   43   129      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
198.07 ms | 1408 KiB | 17 Q