3v4l.org

run code in 300+ PHP versions simultaneously
<?php function _prepareSkuParseRules(){ $structure = array(); $skuStructure = "[#name]-[Stoffgruppe]-[Groesse]-[:Ausfuehrung]-[:Matratze]"; $segments = explode("-", $skuStructure); foreach($segments as $segment){ $segmentInfo = array(); //check if segment is fixed if(!preg_match('/^\[(#)?([^\]#]*)\]$/', $segment, $matches)){ //is fixed value $segmentInfo["type"] = "set"; $segmentInfo["value"] = $matches[2]; }else{ if(isset($matches[1]) && !empty($matches[1]) && strcmp($matches[1], "#")==0){ $segmentInfo["type"] = "set"; $segmentInfo["namespace"] = "both"; //is registered variable name switch($matches[2]){ case "name": $segmentInfo["value"] = "Modellname"; break; } }else{ if(isset($matches[1]) && !empty($matches[1]) && strcmp($matches[1], ":")==0){ $segmentInfo["namespace"] = "simple"; }else{ $segmentInfo["namespace"] = "both"; } $segmentInfo["type"] = "variable"; $segmentInfo["fieldname"] = $matches[2]; } } //check if segment is always $structure[] = $segmentInfo; } var_dump($structure); } _prepareSkuParseRules();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dFn4p
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   37     0  E >   INIT_FCALL                                               '_prepareskuparserules'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function _prepareskuparserules:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 77
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 77
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 23
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 36
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 37, Position 2 = 50
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 44, Position 2 = 45
Branch analysis from position: 44
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
Branch analysis from position: 50
2 jumps found. (Code = 46) Position 1 = 52, Position 2 = 55
Branch analysis from position: 52
2 jumps found. (Code = 46) Position 1 = 56, Position 2 = 63
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 67
Branch analysis from position: 64
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 63
Branch analysis from position: 55
Branch analysis from position: 36
Branch analysis from position: 28
Branch analysis from position: 77
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 77
filename:       /in/dFn4p
function name:  _prepareSkuParseRules
number of ops:  82
compiled vars:  !0 = $structure, !1 = $skuStructure, !2 = $segments, !3 = $segment, !4 = $segmentInfo, !5 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, '%5B%23name%5D-%5BStoffgruppe%5D-%5BGroesse%5D-%5B%3AAusfuehrung%5D-%5B%3AMatratze%5D'
    5     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '-'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $8      
          6        ASSIGN                                                   !2, $8
    6     7      > FE_RESET_R                                       $10     !2, ->77
          8    > > FE_FETCH_R                                               $10, !3, ->77
    7     9    >   ASSIGN                                                   !4, <array>
    9    10        INIT_FCALL                                               'preg_match'
         11        SEND_VAL                                                 '%2F%5E%5C%5B%28%23%29%3F%28%5B%5E%5C%5D%23%5D%2A%29%5C%5D%24%2F'
         12        SEND_VAR                                                 !3
         13        SEND_REF                                                 !5
         14        DO_ICALL                                         $12     
         15        BOOL_NOT                                         ~13     $12
         16      > JMPZ                                                     ~13, ->23
   11    17    >   ASSIGN_DIM                                               !4, 'type'
         18        OP_DATA                                                  'set'
   12    19        FETCH_DIM_R                                      ~16     !5, 2
         20        ASSIGN_DIM                                               !4, 'value'
         21        OP_DATA                                                  ~16
         22      > JMP                                                      ->74
   14    23    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~17     !5, 1
         24      > JMPZ_EX                                          ~17     ~17, ->28
         25    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~18     !5, 1
         26        BOOL_NOT                                         ~19     ~18
         27        BOOL                                             ~17     ~19
         28    > > JMPZ_EX                                          ~17     ~17, ->36
         29    >   INIT_FCALL                                               'strcmp'
         30        FETCH_DIM_R                                      ~20     !5, 1
         31        SEND_VAL                                                 ~20
         32        SEND_VAL                                                 '%23'
         33        DO_ICALL                                         $21     
         34        IS_EQUAL                                         ~22     $21, 0
         35        BOOL                                             ~17     ~22
         36    > > JMPZ                                                     ~17, ->50
   15    37    >   ASSIGN_DIM                                               !4, 'type'
         38        OP_DATA                                                  'set'
   16    39        ASSIGN_DIM                                               !4, 'namespace'
         40        OP_DATA                                                  'both'
   18    41        FETCH_DIM_R                                      ~25     !5, 2
   19    42        CASE                                                     ~25, 'name'
         43      > JMPNZ                                                    ~26, ->45
         44    > > JMP                                                      ->48
         45    >   ASSIGN_DIM                                               !4, 'value'
         46        OP_DATA                                                  'Modellname'
         47      > JMP                                                      ->48
         48    >   FREE                                                     ~25
         49      > JMP                                                      ->74
   22    50    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~28     !5, 1
         51      > JMPZ_EX                                          ~28     ~28, ->55
         52    >   ISSET_ISEMPTY_DIM_OBJ                         1  ~29     !5, 1
         53        BOOL_NOT                                         ~30     ~29
         54        BOOL                                             ~28     ~30
         55    > > JMPZ_EX                                          ~28     ~28, ->63
         56    >   INIT_FCALL                                               'strcmp'
         57        FETCH_DIM_R                                      ~31     !5, 1
         58        SEND_VAL                                                 ~31
         59        SEND_VAL                                                 '%3A'
         60        DO_ICALL                                         $32     
         61        IS_EQUAL                                         ~33     $32, 0
         62        BOOL                                             ~28     ~33
         63    > > JMPZ                                                     ~28, ->67
   23    64    >   ASSIGN_DIM                                               !4, 'namespace'
         65        OP_DATA                                                  'simple'
         66      > JMP                                                      ->69
   25    67    >   ASSIGN_DIM                                               !4, 'namespace'
         68        OP_DATA                                                  'both'
   27    69    >   ASSIGN_DIM                                               !4, 'type'
         70        OP_DATA                                                  'variable'
   28    71        FETCH_DIM_R                                      ~38     !5, 2
         72        ASSIGN_DIM                                               !4, 'fieldname'
         73        OP_DATA                                                  ~38
   32    74    >   ASSIGN_DIM                                               !0
         75        OP_DATA                                                  !4
    6    76      > JMP                                                      ->8
         77    >   FE_FREE                                                  $10
   34    78        INIT_FCALL                                               'var_dump'
         79        SEND_VAR                                                 !0
         80        DO_ICALL                                                 
   35    81      > RETURN                                                   null

End of function _prepareskuparserules

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.64 ms | 1398 KiB | 22 Q