3v4l.org

run code in 300+ PHP versions simultaneously
<?php $query = "UPDATE `benefits` SET `ins_d`='6' WHERE `ben_id`='1' OR `patient_id`='1' LIMIT 0,1"; $sql_operators_arr = array("SET", "VALUES", "FROM", "WHERE", "LEFT JOIN", "RIGHT JOIN", "INNER JOIN", "OUTER JOIN", "JOIN", "GROUP BY", "ORDER BY", "LIMIT", "AND", "OR"); $vals = ""; foreach ($sql_operators_arr AS $val) { $re = "/(.*?)( )*(" . $val . ")(.*)/"; $subst = "$1\n$2$3$4"; $query = preg_replace($re,$subst,$query); } echo $query;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/ZI0TU
function name:  (null)
number of ops:  19
compiled vars:  !0 = $query, !1 = $sql_operators_arr, !2 = $vals, !3 = $val, !4 = $re, !5 = $subst
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'UPDATE+%60benefits%60+SET+%60ins_d%60%3D%276%27+WHERE+%60ben_id%60%3D%271%27+OR+%60patient_id%60%3D%271%27+LIMIT+0%2C1'
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, ''
    7     3      > FE_RESET_R                                       $9      !1, ->16
          4    > > FE_FETCH_R                                               $9, !3, ->16
    9     5    >   CONCAT                                           ~10     '%2F%28.%2A%3F%29%28+%29%2A%28', !3
          6        CONCAT                                           ~11     ~10, '%29%28.%2A%29%2F'
          7        ASSIGN                                                   !4, ~11
   10     8        ASSIGN                                                   !5, '%241%0A%242%243%244'
   11     9        INIT_FCALL                                               'preg_replace'
         10        SEND_VAR                                                 !4
         11        SEND_VAR                                                 !5
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $14     
         14        ASSIGN                                                   !0, $14
    7    15      > JMP                                                      ->4
         16    >   FE_FREE                                                  $9
   14    17        ECHO                                                     !0
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.77 ms | 1395 KiB | 15 Q