3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ipaddress = ''; if($_SERVER['HTTP_X_FORWARDED_FOR'] && ($_SERVER['HTTP_X_FORWARDED_FOR']<>$ipaddress)){ $proxies=explode(",",$_SERVER['HTTP_X_FORWARDED_FOR']); $ipaddress=$proxies[count($proxies)-1]; //$ipaddress=$proxies[0]; }else{ if (getenv('HTTP_CLIENT_IP')){ $ipaddress = getenv('HTTP_CLIENT_IP'); }elseif(getenv('HTTP_X_FORWARDED_FOR')){ $ipaddress = getenv('HTTP_X_FORWARDED_FOR'); }elseif(getenv('HTTP_X_FORWARDED')){ $ipaddress = getenv('HTTP_X_FORWARDED'); }elseif(getenv('HTTP_FORWARDED_FOR')){ $ipaddress = getenv('HTTP_FORWARDED_FOR'); }elseif(getenv('HTTP_FORWARDED')){ $ipaddress = getenv('HTTP_FORWARDED'); }elseif(getenv('REMOTE_ADDR')){ $ipaddress = getenv('REMOTE_ADDR'); }else{ $ipaddress = 'UNKNOWN'; } } //echo $ipaddress; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 21
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 30
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 39
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 48
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 48
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 57
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 66
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 66
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 75
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/qHlVK
function name:  (null)
number of ops:  77
compiled vars:  !0 = $ipaddress, !1 = $proxies
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, ''
    4     1        FETCH_R                      global              ~3      '_SERVER'
          2        FETCH_DIM_R                                      ~4      ~3, 'HTTP_X_FORWARDED_FOR'
          3      > JMPZ_EX                                          ~4      ~4, ->8
          4    >   FETCH_R                      global              ~5      '_SERVER'
          5        FETCH_DIM_R                                      ~6      ~5, 'HTTP_X_FORWARDED_FOR'
          6        IS_NOT_EQUAL                                     ~7      !0, ~6
          7        BOOL                                             ~4      ~7
          8    > > JMPZ                                                     ~4, ->21
    5     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '%2C'
         11        FETCH_R                      global              ~8      '_SERVER'
         12        FETCH_DIM_R                                      ~9      ~8, 'HTTP_X_FORWARDED_FOR'
         13        SEND_VAL                                                 ~9
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !1, $10
    6    16        COUNT                                            ~12     !1
         17        SUB                                              ~13     ~12, 1
         18        FETCH_DIM_R                                      ~14     !1, ~13
         19        ASSIGN                                                   !0, ~14
         20      > JMP                                                      ->76
   11    21    >   INIT_FCALL                                               'getenv'
         22        SEND_VAL                                                 'HTTP_CLIENT_IP'
         23        DO_ICALL                                         $16     
         24      > JMPZ                                                     $16, ->30
   12    25    >   INIT_FCALL                                               'getenv'
         26        SEND_VAL                                                 'HTTP_CLIENT_IP'
         27        DO_ICALL                                         $17     
         28        ASSIGN                                                   !0, $17
         29      > JMP                                                      ->76
   13    30    >   INIT_FCALL                                               'getenv'
         31        SEND_VAL                                                 'HTTP_X_FORWARDED_FOR'
         32        DO_ICALL                                         $19     
         33      > JMPZ                                                     $19, ->39
   14    34    >   INIT_FCALL                                               'getenv'
         35        SEND_VAL                                                 'HTTP_X_FORWARDED_FOR'
         36        DO_ICALL                                         $20     
         37        ASSIGN                                                   !0, $20
         38      > JMP                                                      ->76
   15    39    >   INIT_FCALL                                               'getenv'
         40        SEND_VAL                                                 'HTTP_X_FORWARDED'
         41        DO_ICALL                                         $22     
         42      > JMPZ                                                     $22, ->48
   16    43    >   INIT_FCALL                                               'getenv'
         44        SEND_VAL                                                 'HTTP_X_FORWARDED'
         45        DO_ICALL                                         $23     
         46        ASSIGN                                                   !0, $23
         47      > JMP                                                      ->76
   17    48    >   INIT_FCALL                                               'getenv'
         49        SEND_VAL                                                 'HTTP_FORWARDED_FOR'
         50        DO_ICALL                                         $25     
         51      > JMPZ                                                     $25, ->57
   18    52    >   INIT_FCALL                                               'getenv'
         53        SEND_VAL                                                 'HTTP_FORWARDED_FOR'
         54        DO_ICALL                                         $26     
         55        ASSIGN                                                   !0, $26
         56      > JMP                                                      ->76
   19    57    >   INIT_FCALL                                               'getenv'
         58        SEND_VAL                                                 'HTTP_FORWARDED'
         59        DO_ICALL                                         $28     
         60      > JMPZ                                                     $28, ->66
   20    61    >   INIT_FCALL                                               'getenv'
         62        SEND_VAL                                                 'HTTP_FORWARDED'
         63        DO_ICALL                                         $29     
         64        ASSIGN                                                   !0, $29
         65      > JMP                                                      ->76
   21    66    >   INIT_FCALL                                               'getenv'
         67        SEND_VAL                                                 'REMOTE_ADDR'
         68        DO_ICALL                                         $31     
         69      > JMPZ                                                     $31, ->75
   22    70    >   INIT_FCALL                                               'getenv'
         71        SEND_VAL                                                 'REMOTE_ADDR'
         72        DO_ICALL                                         $32     
         73        ASSIGN                                                   !0, $32
         74      > JMP                                                      ->76
   24    75    >   ASSIGN                                                   !0, 'UNKNOWN'
   28    76    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.85 ms | 1404 KiB | 17 Q