3v4l.org

run code in 300+ PHP versions simultaneously
<?php function sanipath( $path ) { global $patternsPath; global $styleguidePath; $saniPath = str_replace( "../", "", $path ); $saniPath = str_replace( ";", "", $saniPath ); $saniPath = htmlspecialchars( $saniPath ); $saniFile = preg_replace( "/\.[^$]*/", "", $saniPath); $ret = $saniFile . ".html"; return $ret; } var_dump(sanipath('/files/../../../var/www/config.ini'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1cBKN
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'sanipath'
          2        SEND_VAL                                                 '%2Ffiles%2F..%2F..%2F..%2Fvar%2Fwww%2Fconfig.ini'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function sanipath:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1cBKN
function name:  sanipath
number of ops:  29
compiled vars:  !0 = $path, !1 = $patternsPath, !2 = $styleguidePath, !3 = $saniPath, !4 = $saniFile, !5 = $ret
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        BIND_GLOBAL                                              !1, 'patternsPath'
    6     2        BIND_GLOBAL                                              !2, 'styleguidePath'
    8     3        INIT_FCALL                                               'str_replace'
          4        SEND_VAL                                                 '..%2F'
          5        SEND_VAL                                                 ''
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !3, $6
    9     9        INIT_FCALL                                               'str_replace'
         10        SEND_VAL                                                 '%3B'
         11        SEND_VAL                                                 ''
         12        SEND_VAR                                                 !3
         13        DO_ICALL                                         $8      
         14        ASSIGN                                                   !3, $8
   10    15        INIT_FCALL                                               'htmlspecialchars'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                         $10     
         18        ASSIGN                                                   !3, $10
   11    19        INIT_FCALL                                               'preg_replace'
         20        SEND_VAL                                                 '%2F%5C.%5B%5E%24%5D%2A%2F'
         21        SEND_VAL                                                 ''
         22        SEND_VAR                                                 !3
         23        DO_ICALL                                         $12     
         24        ASSIGN                                                   !4, $12
   12    25        CONCAT                                           ~14     !4, '.html'
         26        ASSIGN                                                   !5, ~14
   14    27      > RETURN                                                   !5
   15    28*     > RETURN                                                   null

End of function sanipath

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.66 ms | 1399 KiB | 22 Q