3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Move the temporary uploaded file to its final location, // it should be available at the location "/tmp/boxed/success/agentSvcfRiuOSj5em1t.pdf". $path = '/tmp/boxed/success/'; $mimes = [ 'application/pdf', 'application/x-pdf' ]; $file = $_FILES['agentSvcfRiuOSj5em1t.pdf']; $fileName = $file['name']; if (file_exists($file['name'])) { throw new \Exception('file does not exist'); } if (in_array($mimes,$file['mime'])) { throw new \Exception('mime type not allowed'); } do_move($file['name'], $path.$fileName); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NYPTV
function name:  (null)
number of ops:  34
compiled vars:  !0 = $path, !1 = $mimes, !2 = $file, !3 = $fileName
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ASSIGN                                                   !0, '%2Ftmp%2Fboxed%2Fsuccess%2F'
    8     1        ASSIGN                                                   !1, <array>
   13     2        FETCH_R                      global              ~6      '_FILES'
          3        FETCH_DIM_R                                      ~7      ~6, 'agentSvcfRiuOSj5em1t.pdf'
          4        ASSIGN                                                   !2, ~7
   14     5        FETCH_DIM_R                                      ~9      !2, 'name'
          6        ASSIGN                                                   !3, ~9
   16     7        INIT_FCALL                                               'file_exists'
          8        FETCH_DIM_R                                      ~11     !2, 'name'
          9        SEND_VAL                                                 ~11
         10        DO_ICALL                                         $12     
         11      > JMPZ                                                     $12, ->16
   17    12    >   NEW                                              $13     'Exception'
         13        SEND_VAL_EX                                              'file+does+not+exist'
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $13
   20    16    >   INIT_FCALL                                               'in_array'
         17        SEND_VAR                                                 !1
         18        FETCH_DIM_R                                      ~15     !2, 'mime'
         19        SEND_VAL                                                 ~15
         20        DO_ICALL                                         $16     
         21      > JMPZ                                                     $16, ->26
   21    22    >   NEW                                              $17     'Exception'
         23        SEND_VAL_EX                                              'mime+type+not+allowed'
         24        DO_FCALL                                      0          
         25      > THROW                                         0          $17
   24    26    >   INIT_FCALL_BY_NAME                                       'do_move'
         27        CHECK_FUNC_ARG                                           
         28        FETCH_DIM_FUNC_ARG                               $19     !2, 'name'
         29        SEND_FUNC_ARG                                            $19
         30        CONCAT                                           ~20     !0, !3
         31        SEND_VAL_EX                                              ~20
         32        DO_FCALL                                      0          
   25    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.34 ms | 1396 KiB | 17 Q