3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRemoteAddr() { if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR']) { if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) { $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); return $ips[0]; } else return $_SERVER['HTTP_X_FORWARDED_FOR']; } return $_SERVER['REMOTE_ADDR']; } list($rn1, $rn2) = explode(".",getRemoteAddr()); var_dump($rn1); echo "\n"; var_dump($rn2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/T4bRq
function name:  (null)
number of ops:  19
compiled vars:  !0 = $rn1, !1 = $rn2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'explode'
          1        SEND_VAL                                                 '.'
          2        INIT_FCALL                                               'getremoteaddr'
          3        DO_FCALL                                      0  $2      
          4        SEND_VAR                                                 $2
          5        DO_ICALL                                         $3      
          6        FETCH_LIST_R                                     $4      $3, 0
          7        ASSIGN                                                   !0, $4
          8        FETCH_LIST_R                                     $6      $3, 1
          9        ASSIGN                                                   !1, $6
         10        FREE                                                     $3
   18    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                                 
   19    14        ECHO                                                     '%0A'
   20    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function getremoteaddr:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 27
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 24
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/T4bRq
function name:  getRemoteAddr
number of ops:  31
compiled vars:  !0 = $ips
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_IS                                         ~1      '_SERVER'
          1        ISSET_ISEMPTY_DIM_OBJ                         0  ~2      ~1, 'HTTP_X_FORWARDED_FOR'
          2      > JMPZ_EX                                          ~2      ~2, ->6
          3    >   FETCH_R                      global              ~3      '_SERVER'
          4        FETCH_DIM_R                                      ~4      ~3, 'HTTP_X_FORWARDED_FOR'
          5        BOOL                                             ~2      ~4
          6    > > JMPZ                                                     ~2, ->27
    6     7    >   INIT_FCALL                                               'strpos'
          8        FETCH_R                      global              ~5      '_SERVER'
          9        FETCH_DIM_R                                      ~6      ~5, 'HTTP_X_FORWARDED_FOR'
         10        SEND_VAL                                                 ~6
         11        SEND_VAL                                                 '%2C'
         12        DO_ICALL                                         $7      
         13      > JMPZ                                                     $7, ->24
    8    14    >   INIT_FCALL                                               'explode'
         15        SEND_VAL                                                 '%2C'
         16        FETCH_R                      global              ~8      '_SERVER'
         17        FETCH_DIM_R                                      ~9      ~8, 'HTTP_X_FORWARDED_FOR'
         18        SEND_VAL                                                 ~9
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !0, $10
    9    21        FETCH_DIM_R                                      ~12     !0, 0
         22      > RETURN                                                   ~12
         23*       JMP                                                      ->27
   12    24    >   FETCH_R                      global              ~13     '_SERVER'
         25        FETCH_DIM_R                                      ~14     ~13, 'HTTP_X_FORWARDED_FOR'
         26      > RETURN                                                   ~14
   14    27    >   FETCH_R                      global              ~15     '_SERVER'
         28        FETCH_DIM_R                                      ~16     ~15, 'REMOTE_ADDR'
         29      > RETURN                                                   ~16
   15    30*     > RETURN                                                   null

End of function getremoteaddr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.35 ms | 1403 KiB | 20 Q