3v4l.org

run code in 300+ PHP versions simultaneously
<?php $prefix = "/opt/git/repositories/"; $cwd = "/opt/git/repositories/libs/commponent/common"; $gitwebUrl = 'http://packagist.alpari-ru.dom'; if (substr($cwd, 0, strlen($prefix))) { $relative = substr($cwd, length($prefix) + 1); echo "$gitwebUrl/$relative"; } else { echo "error"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WYAWm
function name:  (null)
number of ops:  26
compiled vars:  !0 = $prefix, !1 = $cwd, !2 = $gitwebUrl, !3 = $relative
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fopt%2Fgit%2Frepositories%2F'
    4     1        ASSIGN                                                   !1, '%2Fopt%2Fgit%2Frepositories%2Flibs%2Fcommponent%2Fcommon'
    5     2        ASSIGN                                                   !2, 'http%3A%2F%2Fpackagist.alpari-ru.dom'
    7     3        INIT_FCALL                                               'substr'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 0
          6        STRLEN                                           ~7      !0
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                         $8      
          9      > JMPZ                                                     $8, ->24
    8    10    >   INIT_FCALL                                               'substr'
         11        SEND_VAR                                                 !1
         12        INIT_FCALL_BY_NAME                                       'length'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0  $9      
         15        ADD                                              ~10     $9, 1
         16        SEND_VAL                                                 ~10
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !3, $11
    9    19        ROPE_INIT                                     3  ~14     !2
         20        ROPE_ADD                                      1  ~14     ~14, '%2F'
         21        ROPE_END                                      2  ~13     ~14, !3
         22        ECHO                                                     ~13
         23      > JMP                                                      ->25
   11    24    >   ECHO                                                     'error'
   12    25    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.17 ms | 1395 KiB | 15 Q