3v4l.org

run code in 500+ PHP versions simultaneously
<?php $queries=" SELECT col1,col2,col3 FROM users WHERE id IN (1,2,3,4); SELECT * FROM references WHERE status = 1 ; SELECT a.col1 , a.col2 , b.col1 FROM table_a a | <--- Here is the caret, run this query INNER JOIN table_b b ON b.id_table_a = a.id WHERE a.id = 5 ; UPDATE table_a SET col1 = 'demo' WHERE id = 3; -- etc, etc, etc"; $rtrimmed=substr($queries,0,strpos($queries,'|')); // remove substr following pipe $ltrimmed=substr($rtrimmed,strrpos($rtrimmed,';')+1); // remove substr upto latest semicolon echo trim($ltrimmed); // remove whitespace on either side echo "\n---\n"; echo preg_match('~;\s*\K[^;|]*?(?= *\|)~',$queries,$out) ? $out[0] : '';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rpBTv
function name:  (null)
number of ops:  27
compiled vars:  !0 = $queries, !1 = $rtrimmed, !2 = $ltrimmed, !3 = $out
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%0ASELECT+col1%2Ccol2%2Ccol3%0AFROM+users%0AWHERE+id+IN+%281%2C2%2C3%2C4%29%3B%0ASELECT+%2A+FROM+references+WHERE+status+%3D+1%0A%3B%0ASELECT+%0A++++a.col1%0A++++%2C+a.col2%0A++++%2C+b.col1+%0AFROM+table_a+a+%7C++++++++++++++++++++++++++++%3C---+Here+is+the+caret%2C+run+this+query%0A++++INNER+JOIN+table_b+b+ON+b.id_table_a+%3D+a.id%0AWHERE+a.id+%3D+5%0A%3B%0AUPDATE+table_a+SET+col1+%3D+%27demo%27+WHERE+id+%3D+3%3B%0A--+etc%2C+etc%2C+etc'
   19     1        FRAMELESS_ICALL_2                strpos              ~5      !0, '%7C'
          2        FRAMELESS_ICALL_3                substr              ~6      !0, 0
          3        OP_DATA                                                      ~5
          4        ASSIGN                                                       !1, ~6
   20     5        INIT_FCALL                                                   'strrpos'
          6        SEND_VAR                                                     !1
          7        SEND_VAL                                                     '%3B'
          8        DO_ICALL                                             $8      
          9        ADD                                                  ~9      $8, 1
         10        FRAMELESS_ICALL_2                substr              ~10     !1, ~9
         11        ASSIGN                                                       !2, ~10
   21    12        FRAMELESS_ICALL_1                trim                ~12     !2
         13        ECHO                                                         ~12
   23    14        ECHO                                                         '%0A---%0A'
   25    15        INIT_FCALL                                                   'preg_match'
         16        SEND_VAL                                                     '%7E%3B%5Cs%2A%5CK%5B%5E%3B%7C%5D%2A%3F%28%3F%3D+%2A%5C%7C%29%7E'
         17        SEND_VAR                                                     !0
         18        SEND_REF                                                     !3
         19        DO_ICALL                                             $13     
         20      > JMPZ                                                         $13, ->24
         21    >   FETCH_DIM_R                                          ~14     !3, 0
         22        QM_ASSIGN                                            ~15     ~14
         23      > JMP                                                          ->25
         24    >   QM_ASSIGN                                            ~15     ''
         25    >   ECHO                                                         ~15
         26      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
155.33 ms | 2027 KiB | 15 Q