3v4l.org

run code in 300+ PHP versions simultaneously
<?php AjaxHelper::add_action('resume_download', function () { AjaxHelper::verify_nonce(); $resumes = isset($_POST['resumes']) ? (array)$_POST['resumes'] : []; $files = []; if (count($resumes) > 0) { foreach ($resumes as $resume) { $resume_file_id = get_post_meta( $resume, 'resume_file', true ); if (!empty($resume_file_id)) { $files[] = get_attached_file($resume_file_id); } } } header('Pragma: public'); header('Accept-Ranges: bytes'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Content-Disposition: attachment; filename="archive.zip"'); header('Content-Type: application/octet-stream'); $fp = popen('zip -j -q -r - ' . implode(' ', array_map('escapeshellarg', $files)), 'r'); $bufsize = 8192; $buff = ''; while (!feof($fp)) { echo fread($fp, $bufsize); } pclose($fp); // AjaxHelper::show_data(['success' => true, 'file' => $result]); });
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JTYgU
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_STATIC_METHOD_CALL                                  'AjaxHelper', 'add_action'
          1        SEND_VAL_EX                                              'resume_download'
          2        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FJTYgU%3A4%240'
   38     3        SEND_VAL_EX                                              ~0
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FJTYgU%3A4%240:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 34
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 33
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 33
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 32
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 69
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 69
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 69
Branch analysis from position: 79
Branch analysis from position: 69
Branch analysis from position: 33
Branch analysis from position: 34
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 34
Branch analysis from position: 16
Branch analysis from position: 34
filename:       /in/JTYgU
function name:  {closure}
number of ops:  83
compiled vars:  !0 = $resumes, !1 = $files, !2 = $resume, !3 = $resume_file_id, !4 = $fp, !5 = $bufsize, !6 = $buff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   INIT_STATIC_METHOD_CALL                                  'AjaxHelper', 'verify_nonce'
          1        DO_FCALL                                      0          
    8     2        FETCH_IS                                         ~8      '_POST'
          3        ISSET_ISEMPTY_DIM_OBJ                         0          ~8, 'resumes'
          4      > JMPZ                                                     ~9, ->10
          5    >   FETCH_R                      global              ~10     '_POST'
          6        FETCH_DIM_R                                      ~11     ~10, 'resumes'
          7        CAST                                          7  ~12     ~11
          8        QM_ASSIGN                                        ~13     ~12
          9      > JMP                                                      ->11
         10    >   QM_ASSIGN                                        ~13     <array>
         11    >   ASSIGN                                                   !0, ~13
   10    12        ASSIGN                                                   !1, <array>
   12    13        COUNT                                            ~16     !0
         14        IS_SMALLER                                               0, ~16
         15      > JMPZ                                                     ~17, ->34
   13    16    > > FE_RESET_R                                       $18     !0, ->33
         17    > > FE_FETCH_R                                               $18, !2, ->33
   14    18    >   INIT_FCALL_BY_NAME                                       'get_post_meta'
         19        SEND_VAR_EX                                              !2
         20        SEND_VAL_EX                                              'resume_file'
         21        SEND_VAL_EX                                              <true>
         22        DO_FCALL                                      0  $19     
         23        ASSIGN                                                   !3, $19
   15    24        ISSET_ISEMPTY_CV                                 ~21     !3
         25        BOOL_NOT                                         ~22     ~21
         26      > JMPZ                                                     ~22, ->32
   16    27    >   INIT_FCALL_BY_NAME                                       'get_attached_file'
         28        SEND_VAR_EX                                              !3
         29        DO_FCALL                                      0  $24     
         30        ASSIGN_DIM                                               !1
         31        OP_DATA                                                  $24
   13    32    > > JMP                                                      ->17
         33    >   FE_FREE                                                  $18
   21    34    >   INIT_FCALL                                               'header'
         35        SEND_VAL                                                 'Pragma%3A+public'
         36        DO_ICALL                                                 
   22    37        INIT_FCALL                                               'header'
         38        SEND_VAL                                                 'Accept-Ranges%3A+bytes'
         39        DO_ICALL                                                 
   23    40        INIT_FCALL                                               'header'
         41        SEND_VAL                                                 'Expires%3A+0'
         42        DO_ICALL                                                 
   24    43        INIT_FCALL                                               'header'
         44        SEND_VAL                                                 'Cache-Control%3A+must-revalidate%2C+post-check%3D0%2C+pre-check%3D0'
         45        DO_ICALL                                                 
   25    46        INIT_FCALL                                               'header'
         47        SEND_VAL                                                 'Content-Disposition%3A+attachment%3B+filename%3D%22archive.zip%22'
         48        DO_ICALL                                                 
   26    49        INIT_FCALL                                               'header'
         50        SEND_VAL                                                 'Content-Type%3A+application%2Foctet-stream'
         51        DO_ICALL                                                 
   28    52        INIT_FCALL                                               'popen'
         53        INIT_FCALL                                               'implode'
         54        SEND_VAL                                                 '+'
         55        INIT_FCALL                                               'array_map'
         56        SEND_VAL                                                 'escapeshellarg'
         57        SEND_VAR                                                 !1
         58        DO_ICALL                                         $31     
         59        SEND_VAR                                                 $31
         60        DO_ICALL                                         $32     
         61        CONCAT                                           ~33     'zip+-j+-q+-r+-+', $32
         62        SEND_VAL                                                 ~33
         63        SEND_VAL                                                 'r'
         64        DO_ICALL                                         $34     
         65        ASSIGN                                                   !4, $34
   30    66        ASSIGN                                                   !5, 8192
   31    67        ASSIGN                                                   !6, ''
   32    68      > JMP                                                      ->74
   33    69    >   INIT_FCALL                                               'fread'
         70        SEND_VAR                                                 !4
         71        SEND_VAR                                                 !5
         72        DO_ICALL                                         $38     
         73        ECHO                                                     $38
   32    74    >   INIT_FCALL                                               'feof'
         75        SEND_VAR                                                 !4
         76        DO_ICALL                                         $39     
         77        BOOL_NOT                                         ~40     $39
         78      > JMPNZ                                                    ~40, ->69
   35    79    >   INIT_FCALL                                               'pclose'
         80        SEND_VAR                                                 !4
         81        DO_ICALL                                                 
   38    82      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FJTYgU%3A4%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.33 ms | 1404 KiB | 27 Q