3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dir_root = '/coucou/test/install/../'; $dir = '/coucou/test/install/../images/logo/0'; if (strpos($dir, $dir_root) === 0) { $dir = './' . substr($dir, strlen(DIR_ROOT) + 1); echo $dir; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/jk017
function name:  (null)
number of ops:  19
compiled vars:  !0 = $dir_root, !1 = $dir
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%2Fcoucou%2Ftest%2Finstall%2F..%2F'
    3     1        ASSIGN                                                   !1, '%2Fcoucou%2Ftest%2Finstall%2F..%2Fimages%2Flogo%2F0'
    5     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        IS_IDENTICAL                                             $4, 0
          7      > JMPZ                                                     ~5, ->18
    6     8    >   INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !1
         10        FETCH_CONSTANT                                   ~6      'DIR_ROOT'
         11        STRLEN                                           ~7      ~6
         12        ADD                                              ~8      ~7, 1
         13        SEND_VAL                                                 ~8
         14        DO_ICALL                                         $9      
         15        CONCAT                                           ~10     '.%2F', $9
         16        ASSIGN                                                   !1, ~10
    8    17        ECHO                                                     !1
    9    18    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
177.44 ms | 1433 KiB | 15 Q