3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(isset($_POST['log'])){ $nm = $_POST['nm']; $ds = $_POST['dl']; foreach($_FILES ['files']["tmp_name"] as $key => $name_tmp){ $name = $_FILES['files']['name'] [$key]; $tmpnm = $_FILES['files']['tmp_name'] [$key]; $type = $_FILES['files']['type'][$key]; $size = $_FILES['files']['size'][$key]; $dir = "filedata".$name; $move = move_uploaded_file($tmpnmn,$dir); if ($move){ echo "<script>alert('terima kasih')</script>"; } else { echo "<script>alert('gagal upload')</script>"; } } } ?> <form action="" method="post" enctype="multipart/form-data"> <p> <label>File</label> <input type="file" name="file[]" multiple/> </p> <p> <label>Name</label> <input type="text" name="nm"/> </p> <p> <textarea rows="10" cols="25" name="dl"></textarea> </p> <p> <input type="submit" name="log" value="upload"/> </p> </form>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 48
Branch analysis from position: 3
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 47
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 47
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 48
filename:       /in/kP5FM
function name:  (null)
number of ops:  50
compiled vars:  !0 = $nm, !1 = $ds, !2 = $name_tmp, !3 = $key, !4 = $name, !5 = $tmpnm, !6 = $type, !7 = $size, !8 = $dir, !9 = $move, !10 = $tmpnmn
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_IS                                         ~11     '_POST'
          1        ISSET_ISEMPTY_DIM_OBJ                         0          ~11, 'log'
          2      > JMPZ                                                     ~12, ->48
    3     3    >   FETCH_R                      global              ~13     '_POST'
          4        FETCH_DIM_R                                      ~14     ~13, 'nm'
          5        ASSIGN                                                   !0, ~14
    4     6        FETCH_R                      global              ~16     '_POST'
          7        FETCH_DIM_R                                      ~17     ~16, 'dl'
          8        ASSIGN                                                   !1, ~17
    5     9        FETCH_R                      global              ~19     '_FILES'
         10        FETCH_DIM_R                                      ~20     ~19, 'files'
         11        FETCH_DIM_R                                      ~21     ~20, 'tmp_name'
         12      > FE_RESET_R                                       $22     ~21, ->47
         13    > > FE_FETCH_R                                       ~23     $22, !2, ->47
         14    >   ASSIGN                                                   !3, ~23
    6    15        FETCH_R                      global              ~25     '_FILES'
         16        FETCH_DIM_R                                      ~26     ~25, 'files'
         17        FETCH_DIM_R                                      ~27     ~26, 'name'
         18        FETCH_DIM_R                                      ~28     ~27, !3
         19        ASSIGN                                                   !4, ~28
    7    20        FETCH_R                      global              ~30     '_FILES'
         21        FETCH_DIM_R                                      ~31     ~30, 'files'
         22        FETCH_DIM_R                                      ~32     ~31, 'tmp_name'
         23        FETCH_DIM_R                                      ~33     ~32, !3
         24        ASSIGN                                                   !5, ~33
    8    25        FETCH_R                      global              ~35     '_FILES'
         26        FETCH_DIM_R                                      ~36     ~35, 'files'
         27        FETCH_DIM_R                                      ~37     ~36, 'type'
         28        FETCH_DIM_R                                      ~38     ~37, !3
         29        ASSIGN                                                   !6, ~38
    9    30        FETCH_R                      global              ~40     '_FILES'
         31        FETCH_DIM_R                                      ~41     ~40, 'files'
         32        FETCH_DIM_R                                      ~42     ~41, 'size'
         33        FETCH_DIM_R                                      ~43     ~42, !3
         34        ASSIGN                                                   !7, ~43
   10    35        CONCAT                                           ~45     'filedata', !4
         36        ASSIGN                                                   !8, ~45
   11    37        INIT_FCALL                                               'move_uploaded_file'
         38        SEND_VAR                                                 !10
         39        SEND_VAR                                                 !8
         40        DO_ICALL                                         $47     
         41        ASSIGN                                                   !9, $47
   12    42      > JMPZ                                                     !9, ->45
   13    43    >   ECHO                                                     '%3Cscript%3Ealert%28%27terima+kasih%27%29%3C%2Fscript%3E'
         44      > JMP                                                      ->46
   15    45    >   ECHO                                                     '%3Cscript%3Ealert%28%27gagal+upload%27%29%3C%2Fscript%3E'
    5    46    > > JMP                                                      ->13
         47    >   FE_FREE                                                  $22
   21    48    >   ECHO                                                     '%3Cform+action%3D%22%22+method%3D%22post%22+enctype%3D%22multipart%2Fform-data%22%3E%0A%09%3Cp%3E%0A%09%09%3Clabel%3EFile%3C%2Flabel%3E%0A%09%09%3Cinput+type%3D%22file%22+name%3D%22file%5B%5D%22+multiple%2F%3E%0A%09%3C%2Fp%3E%0A%09%3Cp%3E%0A%09%09%3Clabel%3EName%3C%2Flabel%3E%0A%09%09%3Cinput+type%3D%22text%22+name%3D%22nm%22%2F%3E%0A%09%3C%2Fp%3E%0A%09%3Cp%3E%0A%09%09%3Ctextarea+rows%3D%2210%22+cols%3D%2225%22+name%3D%22dl%22%3E%3C%2Ftextarea%3E%0A%09%3C%2Fp%3E%0A%09%3Cp%3E%0A%09%09%3Cinput+type%3D%22submit%22+name%3D%22log%22+value%3D%22upload%22%2F%3E%0A%09%3C%2Fp%3E%0A%3C%2Fform%3E'
   36    49      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.77 ms | 1400 KiB | 15 Q