3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach ($_FILES as $file) { // array of valid extensions $validExtensions = array('.jpg', '.jpeg', '.gif', '.png'); // get extension of the uploaded file $fileExtension = strrchr($file['name'], "."); // check if file Extension is on the list of allowed ones if (in_array($fileExtension, $validExtensions)) { $newNamePrefix = time() . '_'; save('uploads/' . $newNamePrefix . $file['name']); echo 'Done ...'; } else { echo 'You must upload an image...'; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 29
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 29
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 27
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/iqh9C
function name:  (null)
number of ops:  31
compiled vars:  !0 = $file, !1 = $validExtensions, !2 = $fileExtension, !3 = $newNamePrefix
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_R                      global              ~4      '_FILES'
          1      > FE_RESET_R                                       $5      ~4, ->29
          2    > > FE_FETCH_R                                               $5, !0, ->29
    4     3    >   ASSIGN                                                   !1, <array>
    6     4        INIT_FCALL                                               'strrchr'
          5        FETCH_DIM_R                                      ~7      !0, 'name'
          6        SEND_VAL                                                 ~7
          7        SEND_VAL                                                 '.'
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
    8    10        INIT_FCALL                                               'in_array'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $10     
         14      > JMPZ                                                     $10, ->27
    9    15    >   INIT_FCALL                                               'time'
         16        DO_ICALL                                         $11     
         17        CONCAT                                           ~12     $11, '_'
         18        ASSIGN                                                   !3, ~12
   10    19        INIT_FCALL_BY_NAME                                       'save'
         20        CONCAT                                           ~14     'uploads%2F', !3
         21        FETCH_DIM_R                                      ~15     !0, 'name'
         22        CONCAT                                           ~16     ~14, ~15
         23        SEND_VAL_EX                                              ~16
         24        DO_FCALL                                      0          
   11    25        ECHO                                                     'Done+...'
         26      > JMP                                                      ->28
   13    27    >   ECHO                                                     'You+must+upload+an+image...'
    2    28    > > JMP                                                      ->2
         29    >   FE_FREE                                                  $5
   20    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.47 ms | 1396 KiB | 19 Q