3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getIp() { $ip = $_SERVER['REMOTE_ADDR']; if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip = $_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } return $ip; } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NfmPJ
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E > > RETURN                                                   1

Function getip:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 18
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/NfmPJ
function name:  getIp
number of ops:  20
compiled vars:  !0 = $ip
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_R                      global              ~1      '_SERVER'
          1        FETCH_DIM_R                                      ~2      ~1, 'REMOTE_ADDR'
          2        ASSIGN                                                   !0, ~2
    5     3        FETCH_IS                                         ~4      '_SERVER'
          4        ISSET_ISEMPTY_DIM_OBJ                         1  ~5      ~4, 'HTTP_CLIENT_IP'
          5        BOOL_NOT                                         ~6      ~5
          6      > JMPZ                                                     ~6, ->11
    6     7    >   FETCH_R                      global              ~7      '_SERVER'
          8        FETCH_DIM_R                                      ~8      ~7, 'HTTP_CLIENT_IP'
          9        ASSIGN                                                   !0, ~8
         10      > JMP                                                      ->18
    7    11    >   FETCH_IS                                         ~10     '_SERVER'
         12        ISSET_ISEMPTY_DIM_OBJ                         1  ~11     ~10, 'HTTP_X_FORWARDED_FOR'
         13        BOOL_NOT                                         ~12     ~11
         14      > JMPZ                                                     ~12, ->18
    8    15    >   FETCH_R                      global              ~13     '_SERVER'
         16        FETCH_DIM_R                                      ~14     ~13, 'HTTP_X_FORWARDED_FOR'
         17        ASSIGN                                                   !0, ~14
   11    18    > > RETURN                                                   !0
   12    19*     > RETURN                                                   null

End of function getip

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
184.8 ms | 1394 KiB | 13 Q