3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $query="DELETE FROM `catalog_package` where id=234; UPDATE `status_history` set status=24 where id between 34 and 231; SELECT mail_id, mail_date, mail_from, mail_to, mail_subject, ( ( SELECT COUNT(*) FROM sys_messagecenter_qmails WHERE qmail_mail_id = mail_id ) + ( SELECT COUNT(*) FROM `sys_messagecenter_rels` WHERE rel_mail_id = mail_id ) ) AS email_total, ( SELECT COUNT(*) FROM `sys_messagecenter_rels` WHERE rel_mail_id = mail_id ) AS email_sent, ( SELECT COUNT(*) FROM `sys_messagecenter_rels` INNER JOIN `sys_email_receives` ON receive_reply_to = rel_sent_id WHERE rel_mail_id = mail_id ) AS email_reply FROM `sys_messagecenter_emails` WHERE mail_draft='No' ORDER BY mail_id ASC LIMIT 0,10;"; if(preg_match_all('/((FROM|JOIN|UPDATE)([\s]+)([a-zA-Z0-9_]+))/', $query, $matches)) { $tables = array_unique($matches[3]); print_r($tables); }
based on j7aoR
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
Jump found. Position 1 = -2
Branch analysis from position: 15
filename:       /in/qILnr
function name:  (null)
number of ops:  16
compiled vars:  !0 = $query, !1 = $matches, !2 = $tables
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  24     0  E >   ASSIGN                                                   !0, 'DELETE+FROM+%60catalog_package%60+where+id%3D234%3B%0A++++++++++++UPDATE+%60status_history%60+set+status%3D24+where+id+between+34+and+231%3B%0A++++++++++++SELECT+mail_id%2C+mail_date%2C+mail_from%2C+mail_to%2C+mail_subject%2C+%28%0A++++++++++++%28%0A++++++++++++SELECT+COUNT%28%2A%29%0A++++++++++++FROM+sys_messagecenter_qmails%0A++++++++++++WHERE+qmail_mail_id+%3D+mail_id%0A++++++++++++%29+%2B+%28%0A++++++++++++SELECT+COUNT%28%2A%29%0A++++++++++++FROM+%60sys_messagecenter_rels%60%0A++++++++++++WHERE+rel_mail_id+%3D+mail_id%0A++++++++++++%29%0A++++++++++++%29+AS+email_total%2C+%28%0A++++++++++++SELECT+COUNT%28%2A%29%0A++++++++++++FROM+%60sys_messagecenter_rels%60%0A++++++++++++WHERE+rel_mail_id+%3D+mail_id%0A++++++++++++%29+AS+email_sent%2C+%28%0A++++++++++++SELECT+COUNT%28%2A%29%0A++++++++++++FROM+%60sys_messagecenter_rels%60%0A++++++++++++INNER+JOIN+%60sys_email_receives%60+ON+receive_reply_to+%3D+rel_sent_id%0A++++++++++++WHERE+rel_mail_id+%3D+mail_id%0A++++++++++++%29+AS+email_reply+FROM+%60sys_messagecenter_emails%60+WHERE+mail_draft%3D%27No%27+ORDER+BY+mail_id+ASC+LIMIT+0%2C10%3B'
  27     1        INIT_FCALL                                               'preg_match_all'
         2        SEND_VAL                                                 '%2F%28%28FROM%7CJOIN%7CUPDATE%29%28%5B%5Cs%5D%2B%29%28%5Ba-zA-Z0-9_%5D%2B%29%29%2F'
         3        SEND_VAR                                                 !0
         4        SEND_REF                                                 !1
         5        DO_ICALL                                         $4      
         6      > JMPZ                                                     $4, ->15
  28     7    >   INIT_FCALL                                               'array_unique'
         8        FETCH_DIM_R                                      $5      !1, 3
         9        SEND_VAR                                                 $5
        10        DO_ICALL                                         $6      
        11        ASSIGN                                                   !2, $6
  29    12        INIT_FCALL                                               'print_r'
        13        SEND_VAR                                                 !2
        14        DO_ICALL                                                 
        15    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.3.0