3v4l.org

run code in 300+ PHP versions simultaneously
<?php function path_relative_to($path, $rel) { $rel_lent = strlen($rel); if (strncmp($path, $rel, strlen($rel)) == 0) { return substr($path, strlen($rel)); } else { return ""; } } var_dump(basename(""));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YACM2
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                                               'basename'
          2        SEND_VAL                                                 ''
          3        DO_ICALL                                         $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function path_relative_to:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YACM2
function name:  path_relative_to
number of ops:  21
compiled vars:  !0 = $path, !1 = $rel, !2 = $rel_lent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        STRLEN                                           ~3      !1
          3        ASSIGN                                                   !2, ~3
    6     4        INIT_FCALL                                               'strncmp'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        STRLEN                                           ~5      !1
          8        SEND_VAL                                                 ~5
          9        DO_ICALL                                         $6      
         10        IS_EQUAL                                                 $6, 0
         11      > JMPZ                                                     ~7, ->19
    8    12    >   INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !0
         14        STRLEN                                           ~8      !1
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                         $9      
         17      > RETURN                                                   $9
         18*       JMP                                                      ->20
   12    19    > > RETURN                                                   ''
   14    20*     > RETURN                                                   null

End of function path_relative_to

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.34 ms | 1396 KiB | 21 Q