3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'SELECT * from `foo` WHERE `foo_id` > 0 LIMIT 5'; $regex = '/ (?P<more1>.*?) (?:WHERE\s+ (?P<where>(?:.(?!GROUP BY|HAVING|ORDER BY|LIMIT))+) )? # removing the ? will capture (?P<more2>.*) /imsx'; \preg_match($regex, $str, $matches); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0T3fe
function name:  (null)
number of ops:  11
compiled vars:  !0 = $str, !1 = $regex, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'SELECT+%2A+from+%60foo%60+WHERE+%60foo_id%60+%3E+0+LIMIT+5'
    4     1        ASSIGN                                                   !1, '%2F%0A++++++++%28%3FP%3Cmore1%3E.%2A%3F%29%0A++++++++%28%3F%3AWHERE%5Cs%2B%0A++++++++++++%28%3FP%3Cwhere%3E%28%3F%3A.%28%3F%21GROUP+BY%7CHAVING%7CORDER+BY%7CLIMIT%29%29%2B%29%0A++++++++%29%3F++++%23+removing+the+%3F+will+capture%0A++++++++%28%3FP%3Cmore2%3E.%2A%29%0A++++%2Fimsx'
   11     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
   12     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.13 ms | 1010 KiB | 15 Q