3v4l.org

run code in 500+ PHP versions simultaneously
<?php @mkdir("/tmp/t/a/b/c",0777,true); file_put_contents("/tmp/t/a/b/b.php","MARKER"); $prefix="/tmp/t/a/b/c/x-"; $p1=$prefix."../../b".".php"; var_dump($p1, file_exists($p1), realpath($p1)); $p2=$prefix."..%2F..%2Fb.php"; var_dump(file_exists("/tmp/t/a/b/c/x-".chr(0)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6NgVO
function name:  (null)
number of ops:  35
compiled vars:  !0 = $prefix, !1 = $p1, !2 = $p2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   BEGIN_SILENCE                                        ~3      
          1        INIT_FCALL                                                   'mkdir'
          2        SEND_VAL                                                     '%2Ftmp%2Ft%2Fa%2Fb%2Fc'
          3        SEND_VAL                                                     511
          4        SEND_VAL                                                     <true>
          5        DO_ICALL                                                     
          6        END_SILENCE                                                  ~3
    3     7        INIT_FCALL                                                   'file_put_contents'
          8        SEND_VAL                                                     '%2Ftmp%2Ft%2Fa%2Fb%2Fb.php'
          9        SEND_VAL                                                     'MARKER'
         10        DO_ICALL                                                     
    4    11        ASSIGN                                                       !0, '%2Ftmp%2Ft%2Fa%2Fb%2Fc%2Fx-'
    5    12        CONCAT                                               ~7      !0, '..%2F..%2Fb'
         13        CONCAT                                               ~8      ~7, '.php'
         14        ASSIGN                                                       !1, ~8
    6    15        INIT_FCALL                                                   'var_dump'
         16        SEND_VAR                                                     !1
         17        INIT_FCALL                                                   'file_exists'
         18        SEND_VAR                                                     !1
         19        DO_ICALL                                             $10     
         20        SEND_VAR                                                     $10
         21        INIT_FCALL                                                   'realpath'
         22        SEND_VAR                                                     !1
         23        DO_ICALL                                             $11     
         24        SEND_VAR                                                     $11
         25        DO_ICALL                                                     
    7    26        CONCAT                                               ~13     !0, '..%252F..%252Fb.php'
         27        ASSIGN                                                       !2, ~13
    8    28        INIT_FCALL                                                   'var_dump'
         29        INIT_FCALL                                                   'file_exists'
         30        SEND_VAL                                                     '%2Ftmp%2Ft%2Fa%2Fb%2Fc%2Fx-%00'
         31        DO_ICALL                                             $15     
         32        SEND_VAR                                                     $15
         33        DO_ICALL                                                     
         34      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
149.26 ms | 801 KiB | 13 Q