3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Utils { public static function getBaseURLPath() { return '/sub-directory/'; } /** * Returns the part of the URL with the BaseURLPath. * * @param $info * * @return string */ public static function buildWithBaseURLPath($info) { $result = ''; $baseURLPath = self::getBaseURLPath(); if (!empty($baseURLPath) && !empty($info)) { $path = explode('/', $info); if (count($path) > 1) { $info = implode('/', array_filter($path)); } $result .= $baseURLPath . $info; } return $result; } } echo Utils::buildWithBaseURLPath('/sub-directory/saml/acs');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1qpDY
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   INIT_STATIC_METHOD_CALL                                  'Utils', 'buildWithBaseURLPath'
          1        SEND_VAL                                                 '%2Fsub-directory%2Fsaml%2Facs'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Class Utils:
Function getbaseurlpath:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1qpDY
function name:  getBaseURLPath
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   '%2Fsub-directory%2F'
    6     1*     > RETURN                                                   null

End of function getbaseurlpath

Function buildwithbaseurlpath:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 30
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 28
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 30
Branch analysis from position: 11
filename:       /in/1qpDY
function name:  buildWithBaseURLPath
number of ops:  32
compiled vars:  !0 = $info, !1 = $result, !2 = $baseURLPath, !3 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   17     1        ASSIGN                                                   !1, ''
   18     2        INIT_STATIC_METHOD_CALL                                  'getBaseURLPath'
          3        DO_FCALL                                      0  $5      
          4        ASSIGN                                                   !2, $5
   19     5        ISSET_ISEMPTY_CV                                 ~7      !2
          6        BOOL_NOT                                         ~8      ~7
          7      > JMPZ_EX                                          ~8      ~8, ->11
          8    >   ISSET_ISEMPTY_CV                                 ~9      !0
          9        BOOL_NOT                                         ~10     ~9
         10        BOOL                                             ~8      ~10
         11    > > JMPZ                                                     ~8, ->30
   20    12    >   INIT_FCALL                                               'explode'
         13        SEND_VAL                                                 '%2F'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $11     
         16        ASSIGN                                                   !3, $11
   21    17        COUNT                                            ~13     !3
         18        IS_SMALLER                                               1, ~13
         19      > JMPZ                                                     ~14, ->28
   22    20    >   INIT_FCALL                                               'implode'
         21        SEND_VAL                                                 '%2F'
         22        INIT_FCALL                                               'array_filter'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                         $15     
         25        SEND_VAR                                                 $15
         26        DO_ICALL                                         $16     
         27        ASSIGN                                                   !0, $16
   24    28    >   CONCAT                                           ~18     !2, !0
         29        ASSIGN_OP                                     8          !1, ~18
   27    30    > > RETURN                                                   !1
   28    31*     > RETURN                                                   null

End of function buildwithbaseurlpath

End of class Utils.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.92 ms | 1433 KiB | 16 Q