3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.43 ms | 1408 KiB | 23 Q