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, length($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 = 12, Position 2 = 26
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5X9WH
function name:  (null)
number of ops:  28
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        INIT_FCALL_BY_NAME                                       'length'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0  $7      
          9        SEND_VAR                                                 $7
         10        DO_ICALL                                         $8      
         11      > JMPZ                                                     $8, ->26
    8    12    >   INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !1
         14        INIT_FCALL_BY_NAME                                       'length'
         15        SEND_VAR_EX                                              !0
         16        DO_FCALL                                      0  $9      
         17        ADD                                              ~10     $9, 1
         18        SEND_VAL                                                 ~10
         19        DO_ICALL                                         $11     
         20        ASSIGN                                                   !3, $11
    9    21        ROPE_INIT                                     3  ~14     !2
         22        ROPE_ADD                                      1  ~14     ~14, '%2F'
         23        ROPE_END                                      2  ~13     ~14, !3
         24        ECHO                                                     ~13
         25      > JMP                                                      ->27
   11    26    >   ECHO                                                     'error'
   12    27    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.14 ms | 941 KiB | 16 Q