3v4l.org

run code in 300+ PHP versions simultaneously
<?php function do_upload() { $upload_conf = array( 'upload_path' => realpath('assets/doc/img/real/'), 'allowed_types' => 'gif|jpg|png|JPEG|JPG', 'max_size' => '30000', 'encrypt_name' => TRUE, 'remove_spaces' => TRUE, 'overwrite' => TRUE ); $this->load->library('upload', $upload_conf); foreach ($_FILES['userfile'] as $key => $val) { $i = 1; foreach ($val as $v) { $field_name = "file_" . $i; $_FILES[$field_name][$key] = $v; $i++; } } unset($_FILES['userfile']); foreach ($_FILES as $field_name => $file) { if (!$this->upload->do_upload($field_name)) { echo $this->image_lib->display_errors(); } else { $upload_data = $this->upload->data(); // Watermark $ori = $upload_data['file_name']; $mr = $upload_data['file_path'] . $ori; $this->watermarking($mr); /* //this is the larger image $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/full/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 0; $config['height'] = 0; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); //this is the larger image $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/medium/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 342; $config['height'] = 342; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); //small image $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/small/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 152; $config['height'] = 152; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); //cropped thumbnail $config['image_library'] = 'gd2'; $config['source_image'] = $upload_data['full_path']; $config['new_image'] = 'assets/doc/img/thumbnails/' . $upload_data['file_name']; $config['maintain_ratio'] = TRUE; $config['width'] = 62; $config['height'] = 62; $this->image_lib->initialize($config); $this->image_lib->resize(); $this->image_lib->clear(); */ // do it! if (!$this->image_lib->resize()) { // if got fail. //$error['resize'][] = $this->image_lib->display_errors(); echo $this->image_lib->display_errors(); } else { // otherwise, put each upload data to an array. $success[] = $upload_data; } } } // see what we get if (count($error > 0)) { $data['error'] = $error; } else { $data['success'] = $upload_data; } $data['multiupload'] = "multiupload"; // Controller $data['view'] = "index_multiupload"; // View $data['module'] = "multiupload"; // Controller $data['error'] = ' '; dump($this->upload->data()); echo Modules::run('template/staff', $data); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0oTlH
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  128     0  E > > RETURN                                                   1

Function do_upload:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 34
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 34
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 32
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 32
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 32
Branch analysis from position: 34
2 jumps found. (Code = 77) Position 1 = 39, Position 2 = 83
Branch analysis from position: 39
2 jumps found. (Code = 78) Position 1 = 40, Position 2 = 83
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 54
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 82
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 54
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 80
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 82
Branch analysis from position: 82
Branch analysis from position: 80
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 87, Position 2 = 90
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 92
Branch analysis from position: 92
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 90
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 83
Branch analysis from position: 34
filename:       /in/0oTlH
function name:  do_upload
number of ops:  113
compiled vars:  !0 = $upload_conf, !1 = $val, !2 = $key, !3 = $i, !4 = $v, !5 = $field_name, !6 = $file, !7 = $upload_data, !8 = $ori, !9 = $mr, !10 = $success, !11 = $error, !12 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                               'realpath'
          1        SEND_VAL                                                 'assets%2Fdoc%2Fimg%2Freal%2F'
          2        DO_ICALL                                         $13     
          3        INIT_ARRAY                                       ~14     $13, 'upload_path'
    9     4        ADD_ARRAY_ELEMENT                                ~14     'gif%7Cjpg%7Cpng%7CJPEG%7CJPG', 'allowed_types'
   10     5        ADD_ARRAY_ELEMENT                                ~14     '30000', 'max_size'
    8     6        ADD_ARRAY_ELEMENT                                ~14     <true>, 'encrypt_name'
          7        ADD_ARRAY_ELEMENT                                ~14     <true>, 'remove_spaces'
          8        ADD_ARRAY_ELEMENT                                ~14     <true>, 'overwrite'
    6     9        ASSIGN                                                   !0, ~14
   16    10        FETCH_THIS                                       $16     
         11        FETCH_OBJ_R                                      ~17     $16, 'load'
         12        INIT_METHOD_CALL                                         ~17, 'library'
         13        SEND_VAL_EX                                              'upload'
         14        SEND_VAR_EX                                              !0
         15        DO_FCALL                                      0          
   19    16        FETCH_R                      global              ~19     '_FILES'
         17        FETCH_DIM_R                                      ~20     ~19, 'userfile'
         18      > FE_RESET_R                                       $21     ~20, ->34
         19    > > FE_FETCH_R                                       ~22     $21, !1, ->34
         20    >   ASSIGN                                                   !2, ~22
   21    21        ASSIGN                                                   !3, 1
   22    22      > FE_RESET_R                                       $25     !1, ->32
         23    > > FE_FETCH_R                                               $25, !4, ->32
   25    24    >   CONCAT                                           ~26     'file_', !3
         25        ASSIGN                                                   !5, ~26
   26    26        FETCH_W                      global              $28     '_FILES'
         27        FETCH_DIM_W                                      $29     $28, !5
         28        ASSIGN_DIM                                               $29, !2
         29        OP_DATA                                                  !4
   27    30        PRE_INC                                                  !3
   22    31      > JMP                                                      ->23
         32    >   FE_FREE                                                  $25
   19    33      > JMP                                                      ->19
         34    >   FE_FREE                                                  $21
   31    35        FETCH_UNSET                                      $32     '_FILES'
         36        UNSET_DIM                                                $32, 'userfile'
   33    37        FETCH_R                      global              ~33     '_FILES'
         38      > FE_RESET_R                                       $34     ~33, ->83
         39    > > FE_FETCH_R                                       ~35     $34, !6, ->83
         40    >   ASSIGN                                                   !5, ~35
   35    41        FETCH_THIS                                       $37     
         42        FETCH_OBJ_R                                      ~38     $37, 'upload'
         43        INIT_METHOD_CALL                                         ~38, 'do_upload'
         44        SEND_VAR_EX                                              !5
         45        DO_FCALL                                      0  $39     
         46        BOOL_NOT                                         ~40     $39
         47      > JMPZ                                                     ~40, ->54
   37    48    >   FETCH_THIS                                       $41     
         49        FETCH_OBJ_R                                      ~42     $41, 'image_lib'
         50        INIT_METHOD_CALL                                         ~42, 'display_errors'
         51        DO_FCALL                                      0  $43     
         52        ECHO                                                     $43
         53      > JMP                                                      ->82
   41    54    >   FETCH_THIS                                       $44     
         55        FETCH_OBJ_R                                      ~45     $44, 'upload'
         56        INIT_METHOD_CALL                                         ~45, 'data'
         57        DO_FCALL                                      0  $46     
         58        ASSIGN                                                   !7, $46
   44    59        FETCH_DIM_R                                      ~48     !7, 'file_name'
         60        ASSIGN                                                   !8, ~48
   45    61        FETCH_DIM_R                                      ~50     !7, 'file_path'
         62        CONCAT                                           ~51     ~50, !8
         63        ASSIGN                                                   !9, ~51
   47    64        FETCH_THIS                                       $53     
         65        INIT_METHOD_CALL                                         $53, 'watermarking'
         66        SEND_VAR_EX                                              !9
         67        DO_FCALL                                      0          
  102    68        FETCH_THIS                                       $55     
         69        FETCH_OBJ_R                                      ~56     $55, 'image_lib'
         70        INIT_METHOD_CALL                                         ~56, 'resize'
         71        DO_FCALL                                      0  $57     
         72        BOOL_NOT                                         ~58     $57
         73      > JMPZ                                                     ~58, ->80
  105    74    >   FETCH_THIS                                       $59     
         75        FETCH_OBJ_R                                      ~60     $59, 'image_lib'
         76        INIT_METHOD_CALL                                         ~60, 'display_errors'
         77        DO_FCALL                                      0  $61     
         78        ECHO                                                     $61
         79      > JMP                                                      ->82
  108    80    >   ASSIGN_DIM                                               !10
         81        OP_DATA                                                  !7
   33    82    > > JMP                                                      ->39
         83    >   FE_FREE                                                  $34
  114    84        IS_SMALLER                                       ~63     0, !11
         85        COUNT                                            ~64     ~63
         86      > JMPZ                                                     ~64, ->90
  115    87    >   ASSIGN_DIM                                               !12, 'error'
         88        OP_DATA                                                  !11
         89      > JMP                                                      ->92
  117    90    >   ASSIGN_DIM                                               !12, 'success'
         91        OP_DATA                                                  !7
  120    92    >   ASSIGN_DIM                                               !12, 'multiupload'
         93        OP_DATA                                                  'multiupload'
  121    94        ASSIGN_DIM                                               !12, 'view'
         95        OP_DATA                                                  'index_multiupload'
  122    96        ASSIGN_DIM                                               !12, 'module'
         97        OP_DATA                                                  'multiupload'
  123    98        ASSIGN_DIM                                               !12, 'error'
         99        OP_DATA                                                  '+'
  125   100        INIT_FCALL_BY_NAME                                       'dump'
        101        FETCH_THIS                                       $71     
        102        FETCH_OBJ_R                                      ~72     $71, 'upload'
        103        INIT_METHOD_CALL                                         ~72, 'data'
        104        DO_FCALL                                      0  $73     
        105        SEND_VAR_NO_REF_EX                                       $73
        106        DO_FCALL                                      0          
  127   107        INIT_STATIC_METHOD_CALL                                  'Modules', 'run'
        108        SEND_VAL_EX                                              'template%2Fstaff'
        109        SEND_VAR_EX                                              !12
        110        DO_FCALL                                      0  $75     
        111        ECHO                                                     $75
  128   112      > RETURN                                                   null

End of function do_upload

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.11 ms | 1400 KiB | 15 Q