3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.9 ms | 1385 KiB | 13 Q