3v4l.org

run code in 300+ PHP versions simultaneously
<?php $val = 'asc and 1 = 1; select * from admin_user desc'; $direction = 'asci'; if (preg_match('/(.*\W)(ASC|DESC)\b/si', $val, $matches)) { $val = trim($matches[1]); $direction = $matches[2]; } var_dump($val, $direction, $matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 15
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/VMXbl
function name:  (null)
number of ops:  21
compiled vars:  !0 = $val, !1 = $direction, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'asc+and+1+%3D+1%3B+select+%2A+from+admin_user+desc'
    3     1        ASSIGN                                                   !1, 'asci'
    5     2        INIT_FCALL                                               'preg_match'
          3        SEND_VAL                                                 '%2F%28.%2A%5CW%29%28ASC%7CDESC%29%5Cb%2Fsi'
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                         $5      
          7      > JMPZ                                                     $5, ->15
    6     8    >   INIT_FCALL                                               'trim'
          9        FETCH_DIM_R                                      ~6      !2, 1
         10        SEND_VAL                                                 ~6
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !0, $7
    7    13        FETCH_DIM_R                                      ~9      !2, 2
         14        ASSIGN                                                   !1, ~9
   10    15    >   INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.32 ms | 1395 KiB | 19 Q