3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strImageFile = "../a....//sdf/dfgh/dfgh.jpg"; // Actually fix the directory traversal vulnerability... while (strpos($strImageFile, "../") !== false) { $strImageFile = str_replace("../", "", $strImageFile); } print $strImageFile; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 14, Position 2 = 2
Branch analysis from position: 14
Branch analysis from position: 2
filename:       /in/gJ66d
function name:  (null)
number of ops:  16
compiled vars:  !0 = $strImageFile
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '..%2Fa....%2F%2Fsdf%2Fdfgh%2Fdfgh.jpg'
    6     1      > JMP                                                      ->8
    7     2    >   INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '..%2F'
          4        SEND_VAL                                                 ''
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $2      
          7        ASSIGN                                                   !0, $2
    6     8    >   INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '..%2F'
         11        DO_ICALL                                         $4      
         12        TYPE_CHECK                                  1018          $4
         13      > JMPNZ                                                    ~5, ->2
   10    14    >   ECHO                                                     !0
   12    15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.78 ms | 940 KiB | 18 Q