3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '/\G(\w+\h*==\h*"[^"]*")(?:\h+(?:OR|AND)\h+|$)/'; $str = 'pageType == "static" OR pageType == "item" AND pageRef == "index"'; 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/1UDSu
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%5CG%28%5Cw%2B%5Ch%2A%3D%3D%5Ch%2A%22%5B%5E%22%5D%2A%22%29%28%3F%3A%5Ch%2B%28%3F%3AOR%7CAND%29%5Ch%2B%7C%24%29%2F'
    4     1        ASSIGN                                                       !1, 'pageType+%3D%3D+%22static%22+OR+pageType+%3D%3D+%22item%22+AND+pageRef+%3D%3D+%22index%22'
    5     2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        SEND_REF                                                     !2
          6        DO_ICALL                                                     
    6     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:
132.45 ms | 1895 KiB | 15 Q