3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "categoryEnglishName:shouji dangers:(newuuid AND deep1条 AND IpCrossRule AND MobileCrossAreaRule) dangers:(FirstTimeImageRule OR DifferentIpmobledress) brid:(881581631eadc6e649b7dcb091a59396 OR 6dde9f581f114e2737bc56719990ec7a)"; if (preg_match_all('/([a-zA-Z]+)\:\(([^\)]+)\)/', $str, $m)) { for ($i = 0; $i < count($m[0]); $i++) { $q = trim($m[0][$i]); if (strlen($q) == 0) continue; $key = $m[1][$i]; $qq = explode(" OR ", $m[2][$i]); if (count($qq) > 1) { $op = " OR "; } else { $qq = explode(" AND ", $m[2][$i]); if (count($qq) <= 1) { $qq = explode(" ", $m[2][$i]); } $op = " AND "; } foreach ($qq as $k => $v) { $qq[$k] = "{$key}:{$v}"; } $str = str_replace($q, "(" . implode($op, $qq) . ")", $str); } } var_dump($str);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 79
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 9
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 9
Branch analysis from position: 79
Branch analysis from position: 9
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 77) Position 1 = 53, Position 2 = 61
Branch analysis from position: 53
2 jumps found. (Code = 78) Position 1 = 54, Position 2 = 61
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
Branch analysis from position: 61
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 9
Branch analysis from position: 79
Branch analysis from position: 9
Branch analysis from position: 61
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 51
Branch analysis from position: 44
2 jumps found. (Code = 77) Position 1 = 53, Position 2 = 61
Branch analysis from position: 53
Branch analysis from position: 61
Branch analysis from position: 51
Branch analysis from position: 79
filename:       /in/pr0Vd
function name:  (null)
number of ops:  83
compiled vars:  !0 = $str, !1 = $m, !2 = $i, !3 = $q, !4 = $key, !5 = $qq, !6 = $op, !7 = $v, !8 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'categoryEnglishName%3Ashouji+dangers%3A%28newuuid+AND+deep1%E6%9D%A1+AND+IpCrossRule+AND+MobileCrossAreaRule%29+dangers%3A%28FirstTimeImageRule+OR+DifferentIpmobledress%29+brid%3A%28881581631eadc6e649b7dcb091a59396+OR+6dde9f581f114e2737bc56719990ec7a%29'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%28%5Ba-zA-Z%5D%2B%29%5C%3A%5C%28%28%5B%5E%5C%29%5D%2B%29%5C%29%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $10     
          6      > JMPZ                                                     $10, ->79
    5     7    >   ASSIGN                                                   !2, 0
          8      > JMP                                                      ->75
    6     9    >   INIT_FCALL                                               'trim'
         10        FETCH_DIM_R                                      ~12     !1, 0
         11        FETCH_DIM_R                                      ~13     ~12, !2
         12        SEND_VAL                                                 ~13
         13        DO_ICALL                                         $14     
         14        ASSIGN                                                   !3, $14
    7    15        STRLEN                                           ~16     !3
         16        IS_EQUAL                                                 ~16, 0
         17      > JMPZ                                                     ~17, ->19
         18    > > JMP                                                      ->74
    8    19    >   FETCH_DIM_R                                      ~18     !1, 1
         20        FETCH_DIM_R                                      ~19     ~18, !2
         21        ASSIGN                                                   !4, ~19
    9    22        INIT_FCALL                                               'explode'
         23        SEND_VAL                                                 '+OR+'
         24        FETCH_DIM_R                                      ~21     !1, 2
         25        FETCH_DIM_R                                      ~22     ~21, !2
         26        SEND_VAL                                                 ~22
         27        DO_ICALL                                         $23     
         28        ASSIGN                                                   !5, $23
   10    29        COUNT                                            ~25     !5
         30        IS_SMALLER                                               1, ~25
         31      > JMPZ                                                     ~26, ->34
   11    32    >   ASSIGN                                                   !6, '+OR+'
         33      > JMP                                                      ->52
   13    34    >   INIT_FCALL                                               'explode'
         35        SEND_VAL                                                 '+AND+'
         36        FETCH_DIM_R                                      ~28     !1, 2
         37        FETCH_DIM_R                                      ~29     ~28, !2
         38        SEND_VAL                                                 ~29
         39        DO_ICALL                                         $30     
         40        ASSIGN                                                   !5, $30
   14    41        COUNT                                            ~32     !5
         42        IS_SMALLER_OR_EQUAL                                      ~32, 1
         43      > JMPZ                                                     ~33, ->51
   15    44    >   INIT_FCALL                                               'explode'
         45        SEND_VAL                                                 '+'
         46        FETCH_DIM_R                                      ~34     !1, 2
         47        FETCH_DIM_R                                      ~35     ~34, !2
         48        SEND_VAL                                                 ~35
         49        DO_ICALL                                         $36     
         50        ASSIGN                                                   !5, $36
   17    51    >   ASSIGN                                                   !6, '+AND+'
   20    52    > > FE_RESET_R                                       $39     !5, ->61
         53    > > FE_FETCH_R                                       ~40     $39, !7, ->61
         54    >   ASSIGN                                                   !8, ~40
   21    55        ROPE_INIT                                     3  ~44     !4
         56        ROPE_ADD                                      1  ~44     ~44, '%3A'
         57        ROPE_END                                      2  ~43     ~44, !7
         58        ASSIGN_DIM                                               !5, !8
         59        OP_DATA                                                  ~43
   20    60      > JMP                                                      ->53
         61    >   FE_FREE                                                  $39
   24    62        INIT_FCALL                                               'str_replace'
         63        SEND_VAR                                                 !3
         64        INIT_FCALL                                               'implode'
         65        SEND_VAR                                                 !6
         66        SEND_VAR                                                 !5
         67        DO_ICALL                                         $46     
         68        CONCAT                                           ~47     '%28', $46
         69        CONCAT                                           ~48     ~47, '%29'
         70        SEND_VAL                                                 ~48
         71        SEND_VAR                                                 !0
         72        DO_ICALL                                         $49     
         73        ASSIGN                                                   !0, $49
    5    74    >   PRE_INC                                                  !2
         75    >   FETCH_DIM_R                                      ~52     !1, 0
         76        COUNT                                            ~53     ~52
         77        IS_SMALLER                                               !2, ~53
         78      > JMPNZ                                                    ~54, ->9
   28    79    >   INIT_FCALL                                               'var_dump'
         80        SEND_VAR                                                 !0
         81        DO_ICALL                                                 
         82      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.07 ms | 1404 KiB | 25 Q