3v4l.org

run code in 300+ PHP versions simultaneously
<?php $target_dir = "uploads/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $uploadOk = 1; $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); // Check if image file is a actual image or fake image if(isset($_POST["submit"])) { $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if($check !== false) { echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { echo "File is not an image."; $uploadOk = 0; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 35
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 33
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/OLJb4
function name:  (null)
number of ops:  36
compiled vars:  !0 = $target_dir, !1 = $target_file, !2 = $uploadOk, !3 = $imageFileType, !4 = $check
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'uploads%2F'
    3     1        INIT_FCALL                                               'basename'
          2        FETCH_R                      global              ~6      '_FILES'
          3        FETCH_DIM_R                                      ~7      ~6, 'fileToUpload'
          4        FETCH_DIM_R                                      ~8      ~7, 'name'
          5        SEND_VAL                                                 ~8
          6        DO_ICALL                                         $9      
          7        CONCAT                                           ~10     !0, $9
          8        ASSIGN                                                   !1, ~10
    4     9        ASSIGN                                                   !2, 1
    5    10        INIT_FCALL                                               'pathinfo'
         11        SEND_VAR                                                 !1
         12        SEND_VAL                                                 4
         13        DO_ICALL                                         $13     
         14        ASSIGN                                                   !3, $13
    7    15        FETCH_IS                                         ~15     '_POST'
         16        ISSET_ISEMPTY_DIM_OBJ                         0          ~15, 'submit'
         17      > JMPZ                                                     ~16, ->35
    8    18    >   INIT_FCALL                                               'getimagesize'
         19        FETCH_R                      global              ~17     '_FILES'
         20        FETCH_DIM_R                                      ~18     ~17, 'fileToUpload'
         21        FETCH_DIM_R                                      ~19     ~18, 'tmp_name'
         22        SEND_VAL                                                 ~19
         23        DO_ICALL                                         $20     
         24        ASSIGN                                                   !4, $20
    9    25        TYPE_CHECK                                  1018          !4
         26      > JMPZ                                                     ~22, ->33
   10    27    >   FETCH_DIM_R                                      ~23     !4, 'mime'
         28        CONCAT                                           ~24     'File+is+an+image+-+', ~23
         29        CONCAT                                           ~25     ~24, '.'
         30        ECHO                                                     ~25
   11    31        ASSIGN                                                   !2, 1
         32      > JMP                                                      ->35
   13    33    >   ECHO                                                     'File+is+not+an+image.'
   14    34        ASSIGN                                                   !2, 0
   17    35    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.5 ms | 1396 KiB | 19 Q