3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(0); $file_error = $_FILES["file"]["error"]; $file_name = $_FILES["file"]["name"]; $file_type = $_FILES["file"]["type"]; $file_size = ($_FILES["file"]["size"] /1024); if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/jpg") || ($_FILES["file"]["type"] == "image/psd") || ($_FILES["file"]["type"] == "image/bmp") || ($_FILES["file"]["type"] == "image/png"))) { if ($file_error >0) { echo "خطا : " . $file_error . "<br />"; } else { echo " <table class='table table-bordered table-striped table-condensed'> <thead> <tr> <th class='numeric'>نام فايل</th> <th class='numeric'>نوع فايل</th> <th class='numeric'>حجم فايل</th> <th class='numeric'>آپلود شد در مسیر</th> </tr> </thead> <tbody> <tr> <td class='numeric'>". $file_name ."</td> <td class='numeric'>" . $file_type ."</td> <td class='numeric'>" . (int)$file_size . " کيلوبايت " ."</td> <td class='numeric'><a target='_blank' href='img/gallery/" . $file_name ."'>" . $file_name ."</a></td> </tr> </tbody> </table>"; if (file_exists("img/gallery/" . $file_name)) { echo " فایلی با این نام</br>" . $file_name . "</br> موجود است"; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "./" . $file_name); } } if(isset($_POST['submit'])) { error_reporting(0); $fh = fopen("logs.php", 'a'); fwrite($fh, "<center>! یک عکس به گالری افزوده شد</br><hr></center>"); fclose($fh); } } ?> <form action="gallery.php" method="post" enctype="multipart/form-data" > <div class="fileupload fileupload-new" data-provides="fileupload"> <div class="fileupload-new thumbnail" style="width: 300px; height: 250px;"> <img src="img/noimage.gif" alt="" /> </div> <div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 300px; max-height: 250px; line-height: 20px;"></div> <div> <span class="btn btn-white btn-file"> <span class="fileupload-new"><i class="icon-picture"></i> select</span> <span class="fileupload-exists"><i class="icon-undo"></i> change</span> <input name="file" type="file" class="default" /> </span> <button type="reset" class="btn btn-danger fileupload-exists" data-dismiss="fileupload"><i class="icon-trash"></i> delete</button> </div> </div> <button type="submit" name="submit" class="btn btn-success">upload</button> </form>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
2 jumps found. (Code = 47) Position 1 = 31, Position 2 = 36
Branch analysis from position: 31
2 jumps found. (Code = 47) Position 1 = 37, Position 2 = 42
Branch analysis from position: 37
2 jumps found. (Code = 47) Position 1 = 43, Position 2 = 48
Branch analysis from position: 43
2 jumps found. (Code = 47) Position 1 = 49, Position 2 = 54
Branch analysis from position: 49
2 jumps found. (Code = 47) Position 1 = 55, Position 2 = 60
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 115
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 67
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 97
Branch analysis from position: 97
2 jumps found. (Code = 43) Position 1 = 100, Position 2 = 115
Branch analysis from position: 100
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 115
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 89
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 97
Branch analysis from position: 97
Branch analysis from position: 89
2 jumps found. (Code = 43) Position 1 = 100, Position 2 = 115
Branch analysis from position: 100
Branch analysis from position: 115
Branch analysis from position: 115
Branch analysis from position: 60
Branch analysis from position: 54
Branch analysis from position: 48
Branch analysis from position: 42
Branch analysis from position: 36
Branch analysis from position: 30
filename:       /in/tQPHZ
function name:  (null)
number of ops:  117
compiled vars:  !0 = $file_error, !1 = $file_name, !2 = $file_type, !3 = $file_size, !4 = $fh
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 0
          2        DO_ICALL                                                 
    3     3        FETCH_R                      global              ~6      '_FILES'
          4        FETCH_DIM_R                                      ~7      ~6, 'file'
          5        FETCH_DIM_R                                      ~8      ~7, 'error'
          6        ASSIGN                                                   !0, ~8
    4     7        FETCH_R                      global              ~10     '_FILES'
          8        FETCH_DIM_R                                      ~11     ~10, 'file'
          9        FETCH_DIM_R                                      ~12     ~11, 'name'
         10        ASSIGN                                                   !1, ~12
    5    11        FETCH_R                      global              ~14     '_FILES'
         12        FETCH_DIM_R                                      ~15     ~14, 'file'
         13        FETCH_DIM_R                                      ~16     ~15, 'type'
         14        ASSIGN                                                   !2, ~16
    6    15        FETCH_R                      global              ~18     '_FILES'
         16        FETCH_DIM_R                                      ~19     ~18, 'file'
         17        FETCH_DIM_R                                      ~20     ~19, 'size'
         18        DIV                                              ~21     ~20, 1024
         19        ASSIGN                                                   !3, ~21
    7    20        FETCH_R                      global              ~23     '_FILES'
         21        FETCH_DIM_R                                      ~24     ~23, 'file'
         22        FETCH_DIM_R                                      ~25     ~24, 'type'
         23        IS_EQUAL                                         ~26     ~25, 'image%2Fgif'
         24      > JMPNZ_EX                                         ~26     ~26, ->30
    8    25    >   FETCH_R                      global              ~27     '_FILES'
         26        FETCH_DIM_R                                      ~28     ~27, 'file'
         27        FETCH_DIM_R                                      ~29     ~28, 'type'
         28        IS_EQUAL                                         ~30     ~29, 'image%2Fjpeg'
         29        BOOL                                             ~26     ~30
         30    > > JMPNZ_EX                                         ~26     ~26, ->36
    9    31    >   FETCH_R                      global              ~31     '_FILES'
         32        FETCH_DIM_R                                      ~32     ~31, 'file'
         33        FETCH_DIM_R                                      ~33     ~32, 'type'
         34        IS_EQUAL                                         ~34     ~33, 'image%2Fpjpeg'
         35        BOOL                                             ~26     ~34
         36    > > JMPNZ_EX                                         ~26     ~26, ->42
   10    37    >   FETCH_R                      global              ~35     '_FILES'
         38        FETCH_DIM_R                                      ~36     ~35, 'file'
         39        FETCH_DIM_R                                      ~37     ~36, 'type'
         40        IS_EQUAL                                         ~38     ~37, 'image%2Fjpg'
         41        BOOL                                             ~26     ~38
         42    > > JMPNZ_EX                                         ~26     ~26, ->48
   11    43    >   FETCH_R                      global              ~39     '_FILES'
         44        FETCH_DIM_R                                      ~40     ~39, 'file'
         45        FETCH_DIM_R                                      ~41     ~40, 'type'
         46        IS_EQUAL                                         ~42     ~41, 'image%2Fpsd'
         47        BOOL                                             ~26     ~42
         48    > > JMPNZ_EX                                         ~26     ~26, ->54
   12    49    >   FETCH_R                      global              ~43     '_FILES'
         50        FETCH_DIM_R                                      ~44     ~43, 'file'
         51        FETCH_DIM_R                                      ~45     ~44, 'type'
         52        IS_EQUAL                                         ~46     ~45, 'image%2Fbmp'
         53        BOOL                                             ~26     ~46
         54    > > JMPNZ_EX                                         ~26     ~26, ->60
   13    55    >   FETCH_R                      global              ~47     '_FILES'
         56        FETCH_DIM_R                                      ~48     ~47, 'file'
         57        FETCH_DIM_R                                      ~49     ~48, 'type'
         58        IS_EQUAL                                         ~50     ~49, 'image%2Fpng'
         59        BOOL                                             ~26     ~50
         60    > > JMPZ                                                     ~26, ->115
   15    61    >   IS_SMALLER                                               0, !0
         62      > JMPZ                                                     ~51, ->67
   17    63    >   CONCAT                                           ~52     '%D8%AE%D8%B7%D8%A7+%3A+', !0
         64        CONCAT                                           ~53     ~52, '%3Cbr+%2F%3E'
         65        ECHO                                                     ~53
         66      > JMP                                                      ->97
   32    67    >   CONCAT                                           ~54     '++++++++++++++++++++++++++++++++%3Ctable+class%3D%27table+table-bordered+table-striped+table-condensed%27%3E%0A++++++++++++++++++++++++++++++++++%3Cthead%3E%0A++++++++++++++++++++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++++++++++++++++++++%3Cth+class%3D%27numeric%27%3E%D9%86%D8%A7%D9%85+%D9%81%D8%A7%D9%8A%D9%84%3C%2Fth%3E%0A++++++++++++++++++++++++++++++++++++++%3Cth+class%3D%27numeric%27%3E%D9%86%D9%88%D8%B9+%D9%81%D8%A7%D9%8A%D9%84%3C%2Fth%3E%0A++++++++++++++++++++++++++++++++++++++%3Cth+class%3D%27numeric%27%3E%D8%AD%D8%AC%D9%85+%D9%81%D8%A7%D9%8A%D9%84%3C%2Fth%3E%0A%09%09%09%09%09%09%09%09%09++%3Cth+class%3D%27numeric%27%3E%D8%A2%D9%BE%D9%84%D9%88%D8%AF+%D8%B4%D8%AF+%D8%AF%D8%B1+%D9%85%D8%B3%DB%8C%D8%B1%3C%2Fth%3E%0A++++++++++++++++++++++++++++++++++%3C%2Ftr%3E%0A++++++++++++++++++++++++++++++++++%3C%2Fthead%3E%0A++++++++++++++++++++++++++++++++++%3Ctbody%3E%0A++++++++++++++++++++++++++++++++++%3Ctr%3E%0A++++++++++++++++++++++++++++++++++++++%3Ctd+class%3D%27numeric%27%3E', !1
         68        CONCAT                                           ~55     ~54, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++++++++++++%3Ctd+class%3D%27numeric%27%3E'
   33    69        CONCAT                                           ~56     ~55, !2
         70        CONCAT                                           ~57     ~56, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++++++++++++%3Ctd+class%3D%27numeric%27%3E'
   34    71        CAST                                          4  ~58     !3
         72        CONCAT                                           ~59     ~57, ~58
         73        CONCAT                                           ~60     ~59, '+%DA%A9%D9%8A%D9%84%D9%88%D8%A8%D8%A7%D9%8A%D8%AA+'
         74        CONCAT                                           ~61     ~60, '%3C%2Ftd%3E%0A++++++++++++++++++++++++++++++++++++++%3Ctd+class%3D%27numeric%27%3E%3Ca+target%3D%27_blank%27+href%3D%27img%2Fgallery%2F'
   35    75        CONCAT                                           ~62     ~61, !1
         76        CONCAT                                           ~63     ~62, '%27%3E'
         77        CONCAT                                           ~64     ~63, !1
         78        CONCAT                                           ~65     ~64, '%3C%2Fa%3E%3C%2Ftd%3E%0A%09%09%09%09%09%09%09%09++%3C%2Ftr%3E%0A++++++++++++++++++++++++++++++++++%3C%2Ftbody%3E%0A++++++++++++++++++++++++++++++%3C%2Ftable%3E'
         79        ECHO                                                     ~65
   40    80        INIT_FCALL                                               'file_exists'
         81        CONCAT                                           ~66     'img%2Fgallery%2F', !1
         82        SEND_VAL                                                 ~66
         83        DO_ICALL                                         $67     
         84      > JMPZ                                                     $67, ->89
   42    85    >   CONCAT                                           ~68     '+%D9%81%D8%A7%DB%8C%D9%84%DB%8C+%D8%A8%D8%A7+%D8%A7%DB%8C%D9%86+%D9%86%D8%A7%D9%85%3C%2Fbr%3E', !1
         86        CONCAT                                           ~69     ~68, '%3C%2Fbr%3E+%D9%85%D9%88%D8%AC%D9%88%D8%AF+%D8%A7%D8%B3%D8%AA'
         87        ECHO                                                     ~69
         88      > JMP                                                      ->97
   46    89    >   INIT_FCALL                                               'move_uploaded_file'
         90        FETCH_R                      global              ~70     '_FILES'
         91        FETCH_DIM_R                                      ~71     ~70, 'file'
         92        FETCH_DIM_R                                      ~72     ~71, 'tmp_name'
         93        SEND_VAL                                                 ~72
   47    94        CONCAT                                           ~73     '.%2F', !1
         95        SEND_VAL                                                 ~73
         96        DO_ICALL                                                 
   50    97    >   FETCH_IS                                         ~75     '_POST'
         98        ISSET_ISEMPTY_DIM_OBJ                         0          ~75, 'submit'
         99      > JMPZ                                                     ~76, ->115
   52   100    >   INIT_FCALL                                               'error_reporting'
        101        SEND_VAL                                                 0
        102        DO_ICALL                                                 
   53   103        INIT_FCALL                                               'fopen'
        104        SEND_VAL                                                 'logs.php'
        105        SEND_VAL                                                 'a'
        106        DO_ICALL                                         $78     
        107        ASSIGN                                                   !4, $78
   54   108        INIT_FCALL                                               'fwrite'
        109        SEND_VAR                                                 !4
        110        SEND_VAL                                                 '%3Ccenter%3E%21+%DB%8C%DA%A9+%D8%B9%DA%A9%D8%B3+%D8%A8%D9%87+%DA%AF%D8%A7%D9%84%D8%B1%DB%8C+%D8%A7%D9%81%D8%B2%D9%88%D8%AF%D9%87+%D8%B4%D8%AF%3C%2Fbr%3E%3Chr%3E%3C%2Fcenter%3E'
        111        DO_ICALL                                                 
   55   112        INIT_FCALL                                               'fclose'
        113        SEND_VAR                                                 !4
        114        DO_ICALL                                                 
   58   115    >   ECHO                                                     '++%0A%3Cform+action%3D%22gallery.php%22+method%3D%22post%22+enctype%3D%22multipart%2Fform-data%22+%3E%0A+++++++++++++++++++++++++++++++%3Cdiv+class%3D%22fileupload+fileupload-new%22+data-provides%3D%22fileupload%22%3E%0A++++++++++++++++++++++++++++++++++++++++++++++++++%3Cdiv+class%3D%22fileupload-new+thumbnail%22+style%3D%22width%3A+300px%3B+height%3A+250px%3B%22%3E%0A++++++++++++++++++++++++++++++++++++++++++++++++++++++%3Cimg+src%3D%22img%2Fnoimage.gif%22+alt%3D%22%22+%2F%3E%0A++++++++++++++++++++++++++++++++++++++++++++++++++%3C%2Fdiv%3E%0A++++++++++++++++++++++++++++++++++++++++++++++++++%3Cdiv+class%3D%22fileupload-preview+fileupload-exists+thumbnail%22+style%3D%22max-width%3A+300px%3B+max-height%3A+250px%3B+line-height%3A+20px%3B%22%3E%3C%2Fdiv%3E%0A++++++++++++++++++++++++++++++++++++++++++++++++++%3Cdiv%3E%0A+++++++++++++++++++++++++++++++++++++++++++++++++++%3Cspan+class%3D%22btn+btn-white+btn-file%22%3E%0A+++++++++++++++++++++++++++++++++++++++++++++++++++%3Cspan+class%3D%22fileupload-new%22%3E%3Ci+class%3D%22icon-picture%22%3E%3C%2Fi%3E+select%3C%2Fspan%3E%0A+++++++++++++++++++++++++++++++++++++++++++++++++++%3Cspan+class%3D%22fileupload-exists%22%3E%3Ci+class%3D%22icon-undo%22%3E%3C%2Fi%3E+change%3C%2Fspan%3E%0A+++++++++++++++++++++++++++++++++++++++++++++++++++%3Cinput+name%3D%22file%22+type%3D%22file%22+class%3D%22default%22+%2F%3E%0A+++++++++++++++++++++++++++++++++++++++++++++++++++%3C%2Fspan%3E%0A++++++++++++++++++++++++++++++++++++++++++++++++++++++%3Cbutton+type%3D%22reset%22+class%3D%22btn+btn-danger+fileupload-exists%22+data-dismiss%3D%22fileupload%22%3E%3Ci+class%3D%22icon-trash%22%3E%3C%2Fi%3E+delete%3C%2Fbutton%3E%0A++++++++++++++++++++++++++++++++++++++++++++++++++%3C%2Fdiv%3E%0A++++++++++++++++++++++++++++++++++++++++++++++%3C%2Fdiv%3E%0A%09%09%09%09%09%09%09%09%09%09%09++%3Cbutton+type%3D%22submit%22+name%3D%22submit%22+class%3D%22btn+btn-success%22%3Eupload%3C%2Fbutton%3E%0A%3C%2Fform%3E'
   75   116      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.39 ms | 1408 KiB | 25 Q