3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/(?:\bif\((?=[^()]*\))|\G(?!^))(.*?==.*?)(?:-(?:AND|OR)-|\)$)/'; $str = 'if(conditionA==valueA-AND-conditionB==valueB-OR-conditionC==valueC)'; preg_match_all($re, $str, $matches); print_r($matches[1]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/L8FuW
function name:  (null)
number of ops:  12
compiled vars:  !0 = $re, !1 = $str, !2 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%2F%28%3F%3A%5Cbif%5C%28%28%3F%3D%5B%5E%28%29%5D%2A%5C%29%29%7C%5CG%28%3F%21%5E%29%29%28.%2A%3F%3D%3D.%2A%3F%29%28%3F%3A-%28%3F%3AAND%7COR%29-%7C%5C%29%24%29%2F'
    4     1        ASSIGN                                                       !1, 'if%28conditionA%3D%3DvalueA-AND-conditionB%3D%3DvalueB-OR-conditionC%3D%3DvalueC%29'
    6     2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        SEND_REF                                                     !2
          6        DO_ICALL                                                     
    7     7        INIT_FCALL                                                   'print_r'
          8        FETCH_DIM_R                                          ~6      !2, 1
          9        SEND_VAL                                                     ~6
         10        DO_ICALL                                                     
         11      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
168.54 ms | 1895 KiB | 15 Q