3v4l.org

run code in 300+ PHP versions simultaneously
<?php //whether ip is from share internet if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip_address = $_SERVER['HTTP_CLIENT_IP']; } //whether ip is from proxy elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR']; } //whether ip is from remote address else { $ip_address = $_SERVER['REMOTE_ADDR']; } echo $ip_address; echo $_SERVER['HTTP_X_FORWARDED_FOR']; $_SERVER['HTTP_CLIENT_IP']; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qCRH5
function name:  (null)
number of ops:  27
compiled vars:  !0 = $ip_address
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   FETCH_IS                                         ~1      '_SERVER'
          1        ISSET_ISEMPTY_DIM_OBJ                         1  ~2      ~1, 'HTTP_CLIENT_IP'
          2        BOOL_NOT                                         ~3      ~2
          3      > JMPZ                                                     ~3, ->8
    5     4    >   FETCH_R                      global              ~4      '_SERVER'
          5        FETCH_DIM_R                                      ~5      ~4, 'HTTP_CLIENT_IP'
          6        ASSIGN                                                   !0, ~5
          7      > JMP                                                      ->19
    8     8    >   FETCH_IS                                         ~7      '_SERVER'
          9        ISSET_ISEMPTY_DIM_OBJ                         1  ~8      ~7, 'HTTP_X_FORWARDED_FOR'
         10        BOOL_NOT                                         ~9      ~8
         11      > JMPZ                                                     ~9, ->16
   10    12    >   FETCH_R                      global              ~10     '_SERVER'
         13        FETCH_DIM_R                                      ~11     ~10, 'HTTP_X_FORWARDED_FOR'
         14        ASSIGN                                                   !0, ~11
         15      > JMP                                                      ->19
   15    16    >   FETCH_R                      global              ~13     '_SERVER'
         17        FETCH_DIM_R                                      ~14     ~13, 'REMOTE_ADDR'
         18        ASSIGN                                                   !0, ~14
   17    19    >   ECHO                                                     !0
   18    20        FETCH_R                      global              ~16     '_SERVER'
         21        FETCH_DIM_R                                      ~17     ~16, 'HTTP_X_FORWARDED_FOR'
         22        ECHO                                                     ~17
   19    23        FETCH_R                      global              ~18     '_SERVER'
         24        FETCH_DIM_R                                      ~19     ~18, 'HTTP_CLIENT_IP'
         25        FREE                                                     ~19
   20    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.61 ms | 1386 KiB | 13 Q