3v4l.org

run code in 300+ PHP versions simultaneously
<?php function IsExternal($link) { $base_url = sprintf("%s://%s%s", isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'] ); return (substr($link,0,strlen($base_url)-1)==$base_url); } echo IsExternal("http://www.google.com");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rTnf1
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'isexternal'
          1        SEND_VAL                                                 'http%3A%2F%2Fwww.google.com'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function isexternal:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/rTnf1
function name:  IsExternal
number of ops:  33
compiled vars:  !0 = $link, !1 = $base_url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'sprintf'
          2        SEND_VAL                                                 '%25s%3A%2F%2F%25s%25s'
    7     3        FETCH_IS                                         ~2      '_SERVER'
          4        ISSET_ISEMPTY_DIM_OBJ                         0  ~3      ~2, 'HTTPS'
          5      > JMPZ_EX                                          ~3      ~3, ->10
          6    >   FETCH_R                      global              ~4      '_SERVER'
          7        FETCH_DIM_R                                      ~5      ~4, 'HTTPS'
          8        IS_NOT_EQUAL                                     ~6      ~5, 'off'
          9        BOOL                                             ~3      ~6
         10    > > JMPZ                                                     ~3, ->13
         11    >   QM_ASSIGN                                        ~7      'https'
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~7      'http'
         14    >   SEND_VAL                                                 ~7
    8    15        FETCH_R                      global              ~8      '_SERVER'
         16        FETCH_DIM_R                                      ~9      ~8, 'HTTP_HOST'
         17        SEND_VAL                                                 ~9
    9    18        FETCH_R                      global              ~10     '_SERVER'
         19        FETCH_DIM_R                                      ~11     ~10, 'REQUEST_URI'
         20        SEND_VAL                                                 ~11
         21        DO_ICALL                                         $12     
    6    22        ASSIGN                                                   !1, $12
   12    23        INIT_FCALL                                               'substr'
         24        SEND_VAR                                                 !0
         25        SEND_VAL                                                 0
         26        STRLEN                                           ~14     !1
         27        SUB                                              ~15     ~14, 1
         28        SEND_VAL                                                 ~15
         29        DO_ICALL                                         $16     
         30        IS_EQUAL                                         ~17     !1, $16
         31      > RETURN                                                   ~17
   13    32*     > RETURN                                                   null

End of function isexternal

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.26 ms | 1403 KiB | 18 Q