3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = "(Field1 = 'Val and ue1') and (Field2 = 'Valu or e2') or (Field3 = 'Value3')"; preg_match_all('~(?:^\(|\G(?!^)(?:\) | \())\K(?:(?:and|or)|[^)]+)~', $input, $m); print_r($m[0]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eJbcc
function name:  (null)
number of ops:  11
compiled vars:  !0 = $input, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%28Field1+%3D+%27Val+and+ue1%27%29+and+%28Field2+%3D+%27Valu+or+e2%27%29+or+%28Field3+%3D+%27Value3%27%29'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%7E%28%3F%3A%5E%5C%28%7C%5CG%28%3F%21%5E%29%28%3F%3A%5C%29+%7C+%5C%28%29%29%5CK%28%3F%3A%28%3F%3Aand%7Cor%29%7C%5B%5E%29%5D%2B%29%7E'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        INIT_FCALL                                               'print_r'
          7        FETCH_DIM_R                                      ~4      !1, 0
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.47 ms | 997 KiB | 15 Q