3v4l.org

run code in 300+ PHP versions simultaneously
<?php function clientIp() { $ipaddress = getenv('HTTP_CLIENT_IP')?: getenv('HTTP_X_FORWARDED_FOR')?: getenv('HTTP_X_FORWARDED')?: getenv('HTTP_FORWARDED_FOR')?: getenv('HTTP_FORWARDED')?: getenv('REMOTE_ADDR'); return $ipaddress; } clientIp();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CCQj4
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'clientip'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function clientip:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CCQj4
function name:  clientIp
number of ops:  31
compiled vars:  !0 = $ipaddress
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'getenv'
          1        SEND_VAL                                                 'HTTP_CLIENT_IP'
          2        DO_ICALL                                         $1      
          3        JMP_SET                                          ~2      $1, ->8
    5     4        INIT_FCALL                                               'getenv'
          5        SEND_VAL                                                 'HTTP_X_FORWARDED_FOR'
          6        DO_ICALL                                         $3      
          7        QM_ASSIGN                                        ~2      $3
          8        JMP_SET                                          ~4      ~2, ->13
    6     9        INIT_FCALL                                               'getenv'
         10        SEND_VAL                                                 'HTTP_X_FORWARDED'
         11        DO_ICALL                                         $5      
         12        QM_ASSIGN                                        ~4      $5
         13        JMP_SET                                          ~6      ~4, ->18
    7    14        INIT_FCALL                                               'getenv'
         15        SEND_VAL                                                 'HTTP_FORWARDED_FOR'
         16        DO_ICALL                                         $7      
         17        QM_ASSIGN                                        ~6      $7
         18        JMP_SET                                          ~8      ~6, ->23
    8    19        INIT_FCALL                                               'getenv'
         20        SEND_VAL                                                 'HTTP_FORWARDED'
         21        DO_ICALL                                         $9      
         22        QM_ASSIGN                                        ~8      $9
         23        JMP_SET                                          ~10     ~8, ->28
    9    24        INIT_FCALL                                               'getenv'
         25        SEND_VAL                                                 'REMOTE_ADDR'
         26        DO_ICALL                                         $11     
         27        QM_ASSIGN                                        ~10     $11
    4    28        ASSIGN                                                   !0, ~10
   11    29      > RETURN                                                   !0
   12    30*     > RETURN                                                   null

End of function clientip

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.68 ms | 943 KiB | 17 Q