3v4l.org

run code in 500+ PHP versions simultaneously
<?php $re = '`substr\([^()]*\)\h*(?:=\h*\'[^\']*\'|IN\h*\([^()]*\))`mi'; $str = <<<STR SELECT * FROM tbl WHERE col_a = 'abc' AND SUBSTR(col_b, 7, 2) = 'cd' AND col_c LIKE 'ACD0%' AND SUBSTR(col_d, 10, 1) IN ('A','B','C') AND SUBSTR(col_e, 5, 3) = 'cde' AND SUBSTR(col_f, 2, 1) IN ('C','D','E') STR; preg_match_all($re, $str, $matches, 0); print_r($matches[0]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7cqHm
function name:  (null)
number of ops:  13
compiled vars:  !0 = $re, !1 = $str, !2 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%60substr%5C%28%5B%5E%28%29%5D%2A%5C%29%5Ch%2A%28%3F%3A%3D%5Ch%2A%27%5B%5E%27%5D%2A%27%7CIN%5Ch%2A%5C%28%5B%5E%28%29%5D%2A%5C%29%29%60mi'
    4     1        ASSIGN                                                       !1, 'SELECT+%2A+%0AFROM+tbl+%0AWHERE+col_a+%3D+%27abc%27+%0AAND+SUBSTR%28col_b%2C+7%2C+2%29+%3D+%27cd%27+%0AAND+col_c+LIKE+%27ACD0%25%27+%0AAND+SUBSTR%28col_d%2C+10%2C+1%29+IN+%28%27A%27%2C%27B%27%2C%27C%27%29+%0AAND+SUBSTR%28col_e%2C+5%2C+3%29+%3D+%27cde%27+%0AAND+SUBSTR%28col_f%2C+2%2C+1%29+IN+%28%27C%27%2C%27D%27%2C%27E%27%29'
   15     2        INIT_FCALL                                                   'preg_match_all'
          3        SEND_VAR                                                     !0
          4        SEND_VAR                                                     !1
          5        SEND_REF                                                     !2
          6        SEND_VAL                                                     0
          7        DO_ICALL                                                     
   17     8        INIT_FCALL                                                   'print_r'
          9        FETCH_DIM_R                                          ~6      !2, 0
         10        SEND_VAL                                                     ~6
         11        DO_ICALL                                                     
         12      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
211.89 ms | 1929 KiB | 15 Q