3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_private_ip($ip) { if (empty($ip) or !ip2long($ip)) { return NULL; } $private_ips = array ( array('10.0.0.0','10.255.255.255'), array('172.16.0.0','172.31.255.255'), array('192.168.0.0','192.168.255.255') ); $ip = ip2long($ip); foreach ($private_ips as $ipr) { $min = ip2long($ipr[0]); $max = ip2long($ipr[1]); if (($ip >= $min) && ($ip <= $max)) return true; } return false; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cLupC
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E > > RETURN                                                   1

Function is_private_ip:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 35
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 35
Branch analysis from position: 17
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 31
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
Branch analysis from position: 8
filename:       /in/cLupC
function name:  is_private_ip
number of ops:  38
compiled vars:  !0 = $ip, !1 = $private_ips, !2 = $ipr, !3 = $min, !4 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ISSET_ISEMPTY_CV                                 ~5      !0
          2      > JMPNZ_EX                                         ~5      ~5, ->8
          3    >   INIT_FCALL                                               'ip2long'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        BOOL_NOT                                         ~7      $6
          7        BOOL                                             ~5      ~7
          8    > > JMPZ                                                     ~5, ->10
    5     9    > > RETURN                                                   null
    8    10    >   ASSIGN                                                   !1, <array>
   14    11        INIT_FCALL                                               'ip2long'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $9      
         14        ASSIGN                                                   !0, $9
   15    15      > FE_RESET_R                                       $11     !1, ->35
         16    > > FE_FETCH_R                                               $11, !2, ->35
   16    17    >   INIT_FCALL                                               'ip2long'
         18        FETCH_DIM_R                                      ~12     !2, 0
         19        SEND_VAL                                                 ~12
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !3, $13
   17    22        INIT_FCALL                                               'ip2long'
         23        FETCH_DIM_R                                      ~15     !2, 1
         24        SEND_VAL                                                 ~15
         25        DO_ICALL                                         $16     
         26        ASSIGN                                                   !4, $16
   18    27        IS_SMALLER_OR_EQUAL                              ~18     !3, !0
         28      > JMPZ_EX                                          ~18     ~18, ->31
         29    >   IS_SMALLER_OR_EQUAL                              ~19     !0, !4
         30        BOOL                                             ~18     ~19
         31    > > JMPZ                                                     ~18, ->34
         32    >   FE_FREE                                                  $11
         33      > RETURN                                                   <true>
   15    34    > > JMP                                                      ->16
         35    >   FE_FREE                                                  $11
   20    36      > RETURN                                                   <false>
   21    37*     > RETURN                                                   null

End of function is_private_ip

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.6 ms | 1400 KiB | 15 Q