3v4l.org

run code in 300+ PHP versions simultaneously
<?php //select all attachments $attachments_select="('".implode("', '", $VAR['add_attachments'])."')"; $q = "SELECT * FROM ".PRFX."TABLE_WORK_ORDER_ATTACHMENTS WHERE `WO_ID`=".$db->qstr($wo_id)." AND `ATTACHMENT_ID` IN $attachments_select ORDER BY `ATTACHMENT_ID` DESC"; if(!$rs = $db->execute($q)) { force_page('core', 'error&error_msg=MySQL Error: '.$db->ErrorMsg().'&menu=1&type=database'); exit; } $attachments = $rs->GetArray(); foreach($attachments as $a){ $file=$a['WO_ID']."_".$a['ATTACHMENT_NUMBER']."_".$a['ATTACHMENT_FILE']; $email->addAttachment(FILE_ROOT.'upload/message_store/'.$file, $file); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 35
Branch analysis from position: 26
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 56
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 56
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
filename:       /in/ZjmcA
function name:  (null)
number of ops:  58
compiled vars:  !0 = $attachments_select, !1 = $VAR, !2 = $q, !3 = $db, !4 = $wo_id, !5 = $rs, !6 = $attachments, !7 = $a, !8 = $file, !9 = $email
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'implode'
          1        SEND_VAL                                                 '%27%2C+%27'
          2        FETCH_DIM_R                                      ~10     !1, 'add_attachments'
          3        SEND_VAL                                                 ~10
          4        DO_ICALL                                         $11     
          5        CONCAT                                           ~12     '%28%27', $11
          6        CONCAT                                           ~13     ~12, '%27%29'
          7        ASSIGN                                                   !0, ~13
    6     8        FETCH_CONSTANT                                   ~15     'PRFX'
          9        CONCAT                                           ~16     'SELECT+%2A+FROM+', ~15
         10        CONCAT                                           ~17     ~16, 'TABLE_WORK_ORDER_ATTACHMENTS+WHERE+%60WO_ID%60%3D'
         11        INIT_METHOD_CALL                                         !3, 'qstr'
         12        SEND_VAR_EX                                              !4
         13        DO_FCALL                                      0  $18     
         14        CONCAT                                           ~19     ~17, $18
         15        ROPE_INIT                                     3  ~21     '+AND+%60ATTACHMENT_ID%60+IN+'
         16        ROPE_ADD                                      1  ~21     ~21, !0
         17        ROPE_END                                      2  ~20     ~21, '+ORDER+BY+%60ATTACHMENT_ID%60+DESC'
         18        CONCAT                                           ~23     ~19, ~20
         19        ASSIGN                                                   !2, ~23
    8    20        INIT_METHOD_CALL                                         !3, 'execute'
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0  $25     
         23        ASSIGN                                           ~26     !5, $25
         24        BOOL_NOT                                         ~27     ~26
         25      > JMPZ                                                     ~27, ->35
    9    26    >   INIT_FCALL_BY_NAME                                       'force_page'
         27        SEND_VAL_EX                                              'core'
         28        INIT_METHOD_CALL                                         !3, 'ErrorMsg'
         29        DO_FCALL                                      0  $28     
         30        CONCAT                                           ~29     'error%26error_msg%3DMySQL+Error%3A+', $28
         31        CONCAT                                           ~30     ~29, '%26menu%3D1%26type%3Ddatabase'
         32        SEND_VAL_EX                                              ~30
         33        DO_FCALL                                      0          
   10    34      > EXIT                                                     
   13    35    >   INIT_METHOD_CALL                                         !5, 'GetArray'
         36        DO_FCALL                                      0  $32     
         37        ASSIGN                                                   !6, $32
   15    38      > FE_RESET_R                                       $34     !6, ->56
         39    > > FE_FETCH_R                                               $34, !7, ->56
   16    40    >   FETCH_DIM_R                                      ~35     !7, 'WO_ID'
         41        CONCAT                                           ~36     ~35, '_'
         42        FETCH_DIM_R                                      ~37     !7, 'ATTACHMENT_NUMBER'
         43        CONCAT                                           ~38     ~36, ~37
         44        CONCAT                                           ~39     ~38, '_'
         45        FETCH_DIM_R                                      ~40     !7, 'ATTACHMENT_FILE'
         46        CONCAT                                           ~41     ~39, ~40
         47        ASSIGN                                                   !8, ~41
   17    48        INIT_METHOD_CALL                                         !9, 'addAttachment'
         49        FETCH_CONSTANT                                   ~43     'FILE_ROOT'
         50        CONCAT                                           ~44     ~43, 'upload%2Fmessage_store%2F'
         51        CONCAT                                           ~45     ~44, !8
         52        SEND_VAL_EX                                              ~45
         53        SEND_VAR_EX                                              !8
         54        DO_FCALL                                      0          
   15    55      > JMP                                                      ->39
         56    >   FE_FREE                                                  $34
   18    57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.63 ms | 1400 KiB | 15 Q