3v4l.org

run code in 300+ PHP versions simultaneously
<?php $allowedExts = array("gif", "jpeg", "jpg", "png", "mpeg", "avi"); $temp = explode(".", $_FILES["file"]["name"]); $extension = end($temp); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/x-png") || ($_FILES["file"]["type"] == "image/png") || ($_FILES["file"]["type"] == "video/mpeg") || ($_FILES["file"]["type"] == "video/x-msvideo") || ($_FILES["file"]["type"] == "video/avi") || ($_FILES["file"]["type"] == "video/msvideo")) && ($_FILES["file"]["size"] < 2000000000) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; print_r($_FILES); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 47) Position 1 = 24, Position 2 = 29
Branch analysis from position: 24
2 jumps found. (Code = 47) Position 1 = 30, Position 2 = 35
Branch analysis from position: 30
2 jumps found. (Code = 47) Position 1 = 36, Position 2 = 41
Branch analysis from position: 36
2 jumps found. (Code = 47) Position 1 = 42, Position 2 = 47
Branch analysis from position: 42
2 jumps found. (Code = 47) Position 1 = 48, Position 2 = 53
Branch analysis from position: 48
2 jumps found. (Code = 47) Position 1 = 54, Position 2 = 59
Branch analysis from position: 54
2 jumps found. (Code = 47) Position 1 = 60, Position 2 = 65
Branch analysis from position: 60
2 jumps found. (Code = 47) Position 1 = 66, Position 2 = 71
Branch analysis from position: 66
2 jumps found. (Code = 46) Position 1 = 72, Position 2 = 77
Branch analysis from position: 72
2 jumps found. (Code = 46) Position 1 = 78, Position 2 = 83
Branch analysis from position: 78
2 jumps found. (Code = 43) Position 1 = 84, Position 2 = 152
Branch analysis from position: 84
2 jumps found. (Code = 43) Position 1 = 89, Position 2 = 96
Branch analysis from position: 89
1 jumps found. (Code = 42) Position 1 = 151
Branch analysis from position: 151
1 jumps found. (Code = 42) Position 1 = 157
Branch analysis from position: 157
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 96
2 jumps found. (Code = 43) Position 1 = 129, Position 2 = 135
Branch analysis from position: 129
1 jumps found. (Code = 42) Position 1 = 151
Branch analysis from position: 151
Branch analysis from position: 135
1 jumps found. (Code = 42) Position 1 = 157
Branch analysis from position: 157
Branch analysis from position: 152
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 83
Branch analysis from position: 77
Branch analysis from position: 71
Branch analysis from position: 65
Branch analysis from position: 59
Branch analysis from position: 53
Branch analysis from position: 47
Branch analysis from position: 41
Branch analysis from position: 35
Branch analysis from position: 29
Branch analysis from position: 23
filename:       /in/il4gS
function name:  (null)
number of ops:  158
compiled vars:  !0 = $allowedExts, !1 = $temp, !2 = $extension
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        FETCH_R                      global              ~4      '_FILES'
          4        FETCH_DIM_R                                      ~5      ~4, 'file'
          5        FETCH_DIM_R                                      ~6      ~5, 'name'
          6        SEND_VAL                                                 ~6
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !1, $7
    5     9        INIT_FCALL                                               'end'
         10        SEND_REF                                                 !1
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !2, $9
    6    13        FETCH_R                      global              ~11     '_FILES'
         14        FETCH_DIM_R                                      ~12     ~11, 'file'
         15        FETCH_DIM_R                                      ~13     ~12, 'type'
         16        IS_EQUAL                                         ~14     ~13, 'image%2Fgif'
         17      > JMPNZ_EX                                         ~14     ~14, ->23
    7    18    >   FETCH_R                      global              ~15     '_FILES'
         19        FETCH_DIM_R                                      ~16     ~15, 'file'
         20        FETCH_DIM_R                                      ~17     ~16, 'type'
         21        IS_EQUAL                                         ~18     ~17, 'image%2Fjpeg'
         22        BOOL                                             ~14     ~18
         23    > > JMPNZ_EX                                         ~14     ~14, ->29
    8    24    >   FETCH_R                      global              ~19     '_FILES'
         25        FETCH_DIM_R                                      ~20     ~19, 'file'
         26        FETCH_DIM_R                                      ~21     ~20, 'type'
         27        IS_EQUAL                                         ~22     ~21, 'image%2Fjpg'
         28        BOOL                                             ~14     ~22
         29    > > JMPNZ_EX                                         ~14     ~14, ->35
    9    30    >   FETCH_R                      global              ~23     '_FILES'
         31        FETCH_DIM_R                                      ~24     ~23, 'file'
         32        FETCH_DIM_R                                      ~25     ~24, 'type'
         33        IS_EQUAL                                         ~26     ~25, 'image%2Fpjpeg'
         34        BOOL                                             ~14     ~26
         35    > > JMPNZ_EX                                         ~14     ~14, ->41
   10    36    >   FETCH_R                      global              ~27     '_FILES'
         37        FETCH_DIM_R                                      ~28     ~27, 'file'
         38        FETCH_DIM_R                                      ~29     ~28, 'type'
         39        IS_EQUAL                                         ~30     ~29, 'image%2Fx-png'
         40        BOOL                                             ~14     ~30
         41    > > JMPNZ_EX                                         ~14     ~14, ->47
   11    42    >   FETCH_R                      global              ~31     '_FILES'
         43        FETCH_DIM_R                                      ~32     ~31, 'file'
         44        FETCH_DIM_R                                      ~33     ~32, 'type'
         45        IS_EQUAL                                         ~34     ~33, 'image%2Fpng'
         46        BOOL                                             ~14     ~34
         47    > > JMPNZ_EX                                         ~14     ~14, ->53
   12    48    >   FETCH_R                      global              ~35     '_FILES'
         49        FETCH_DIM_R                                      ~36     ~35, 'file'
         50        FETCH_DIM_R                                      ~37     ~36, 'type'
         51        IS_EQUAL                                         ~38     ~37, 'video%2Fmpeg'
         52        BOOL                                             ~14     ~38
         53    > > JMPNZ_EX                                         ~14     ~14, ->59
   13    54    >   FETCH_R                      global              ~39     '_FILES'
         55        FETCH_DIM_R                                      ~40     ~39, 'file'
         56        FETCH_DIM_R                                      ~41     ~40, 'type'
         57        IS_EQUAL                                         ~42     ~41, 'video%2Fx-msvideo'
         58        BOOL                                             ~14     ~42
         59    > > JMPNZ_EX                                         ~14     ~14, ->65
   14    60    >   FETCH_R                      global              ~43     '_FILES'
         61        FETCH_DIM_R                                      ~44     ~43, 'file'
         62        FETCH_DIM_R                                      ~45     ~44, 'type'
         63        IS_EQUAL                                         ~46     ~45, 'video%2Favi'
         64        BOOL                                             ~14     ~46
         65    > > JMPNZ_EX                                         ~14     ~14, ->71
   15    66    >   FETCH_R                      global              ~47     '_FILES'
         67        FETCH_DIM_R                                      ~48     ~47, 'file'
         68        FETCH_DIM_R                                      ~49     ~48, 'type'
         69        IS_EQUAL                                         ~50     ~49, 'video%2Fmsvideo'
         70        BOOL                                             ~14     ~50
         71    > > JMPZ_EX                                          ~14     ~14, ->77
   17    72    >   FETCH_R                      global              ~51     '_FILES'
         73        FETCH_DIM_R                                      ~52     ~51, 'file'
         74        FETCH_DIM_R                                      ~53     ~52, 'size'
         75        IS_SMALLER                                       ~54     ~53, 2000000000
         76        BOOL                                             ~14     ~54
         77    > > JMPZ_EX                                          ~14     ~14, ->83
   18    78    >   INIT_FCALL                                               'in_array'
         79        SEND_VAR                                                 !2
         80        SEND_VAR                                                 !0
         81        DO_ICALL                                         $55     
         82        BOOL                                             ~14     $55
         83    > > JMPZ                                                     ~14, ->152
   20    84    >   FETCH_R                      global              ~56     '_FILES'
         85        FETCH_DIM_R                                      ~57     ~56, 'file'
         86        FETCH_DIM_R                                      ~58     ~57, 'error'
         87        IS_SMALLER                                               0, ~58
         88      > JMPZ                                                     ~59, ->96
   22    89    >   FETCH_R                      global              ~60     '_FILES'
         90        FETCH_DIM_R                                      ~61     ~60, 'file'
         91        FETCH_DIM_R                                      ~62     ~61, 'error'
         92        CONCAT                                           ~63     'Return+Code%3A+', ~62
         93        CONCAT                                           ~64     ~63, '%3Cbr%3E'
         94        ECHO                                                     ~64
         95      > JMP                                                      ->151
   26    96    >   FETCH_R                      global              ~65     '_FILES'
         97        FETCH_DIM_R                                      ~66     ~65, 'file'
         98        FETCH_DIM_R                                      ~67     ~66, 'name'
         99        CONCAT                                           ~68     'Upload%3A+', ~67
        100        CONCAT                                           ~69     ~68, '%3Cbr%3E'
        101        ECHO                                                     ~69
   27   102        FETCH_R                      global              ~70     '_FILES'
        103        FETCH_DIM_R                                      ~71     ~70, 'file'
        104        FETCH_DIM_R                                      ~72     ~71, 'type'
        105        CONCAT                                           ~73     'Type%3A+', ~72
        106        CONCAT                                           ~74     ~73, '%3Cbr%3E'
        107        ECHO                                                     ~74
   28   108        FETCH_R                      global              ~75     '_FILES'
        109        FETCH_DIM_R                                      ~76     ~75, 'file'
        110        FETCH_DIM_R                                      ~77     ~76, 'size'
        111        DIV                                              ~78     ~77, 1024
        112        CONCAT                                           ~79     'Size%3A+', ~78
        113        CONCAT                                           ~80     ~79, '+kB%3Cbr%3E'
        114        ECHO                                                     ~80
   29   115        FETCH_R                      global              ~81     '_FILES'
        116        FETCH_DIM_R                                      ~82     ~81, 'file'
        117        FETCH_DIM_R                                      ~83     ~82, 'tmp_name'
        118        CONCAT                                           ~84     'Temp+file%3A+', ~83
        119        CONCAT                                           ~85     ~84, '%3Cbr%3E'
        120        ECHO                                                     ~85
   31   121        INIT_FCALL                                               'file_exists'
        122        FETCH_R                      global              ~86     '_FILES'
        123        FETCH_DIM_R                                      ~87     ~86, 'file'
        124        FETCH_DIM_R                                      ~88     ~87, 'name'
        125        CONCAT                                           ~89     'upload%2F', ~88
        126        SEND_VAL                                                 ~89
        127        DO_ICALL                                         $90     
        128      > JMPZ                                                     $90, ->135
   33   129    >   FETCH_R                      global              ~91     '_FILES'
        130        FETCH_DIM_R                                      ~92     ~91, 'file'
        131        FETCH_DIM_R                                      ~93     ~92, 'name'
        132        CONCAT                                           ~94     ~93, '+already+exists.+'
        133        ECHO                                                     ~94
        134      > JMP                                                      ->151
   37   135    >   INIT_FCALL                                               'move_uploaded_file'
        136        FETCH_R                      global              ~95     '_FILES'
        137        FETCH_DIM_R                                      ~96     ~95, 'file'
        138        FETCH_DIM_R                                      ~97     ~96, 'tmp_name'
        139        SEND_VAL                                                 ~97
   38   140        FETCH_R                      global              ~98     '_FILES'
        141        FETCH_DIM_R                                      ~99     ~98, 'file'
        142        FETCH_DIM_R                                      ~100    ~99, 'name'
        143        CONCAT                                           ~101    'upload%2F', ~100
        144        SEND_VAL                                                 ~101
        145        DO_ICALL                                                 
   39   146        FETCH_R                      global              ~103    '_FILES'
        147        FETCH_DIM_R                                      ~104    ~103, 'file'
        148        FETCH_DIM_R                                      ~105    ~104, 'name'
        149        CONCAT                                           ~106    'Stored+in%3A+upload%2F', ~105
        150        ECHO                                                     ~106
        151    > > JMP                                                      ->157
   45   152    >   ECHO                                                     'Invalid+file'
   46   153        INIT_FCALL                                               'print_r'
        154        FETCH_R                      global              ~107    '_FILES'
        155        SEND_VAL                                                 ~107
        156        DO_ICALL                                                 
   48   157    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.81 ms | 1408 KiB | 25 Q