3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (ip_vs_net("192.168.0.16","192.168.0.0","255.255.255.240")){ print "Адрес принадлежит сети"; }else{ print "Адрес не входит в подсеть"; } function ip_vs_net($ip,$network,$mask){ echo ip2long($ip)."\n"; echo ip2long($network)."\n"; echo ip2long($mask)."\n"; echo ((ip2long($ip))&(ip2long($mask)))."\n"; if (((ip2long($ip))&(ip2long($mask)))==ip2long($network)){ return 1; }else{ return 0; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3TT54
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'ip_vs_net'
          1        SEND_VAL_EX                                              '192.168.0.16'
          2        SEND_VAL_EX                                              '192.168.0.0'
          3        SEND_VAL_EX                                              '255.255.255.240'
          4        DO_FCALL                                      0  $0      
          5      > JMPZ                                                     $0, ->8
    4     6    >   ECHO                                                     '%D0%90%D0%B4%D1%80%D0%B5%D1%81+%D0%BF%D1%80%D0%B8%D0%BD%D0%B0%D0%B4%D0%BB%D0%B5%D0%B6%D0%B8%D1%82+%D1%81%D0%B5%D1%82%D0%B8'
          7      > JMP                                                      ->9
    6     8    >   ECHO                                                     '%D0%90%D0%B4%D1%80%D0%B5%D1%81+%D0%BD%D0%B5+%D0%B2%D1%85%D0%BE%D0%B4%D0%B8%D1%82+%D0%B2+%D0%BF%D0%BE%D0%B4%D1%81%D0%B5%D1%82%D1%8C'
   19     9    > > RETURN                                                   1

Function ip_vs_net:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 41
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3TT54
function name:  ip_vs_net
number of ops:  43
compiled vars:  !0 = $ip, !1 = $network, !2 = $mask
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        INIT_FCALL                                               'ip2long'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        CONCAT                                           ~4      $3, '%0A'
          7        ECHO                                                     ~4
   10     8        INIT_FCALL                                               'ip2long'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $5      
         11        CONCAT                                           ~6      $5, '%0A'
         12        ECHO                                                     ~6
   11    13        INIT_FCALL                                               'ip2long'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                         $7      
         16        CONCAT                                           ~8      $7, '%0A'
         17        ECHO                                                     ~8
   12    18        INIT_FCALL                                               'ip2long'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $9      
         21        INIT_FCALL                                               'ip2long'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $10     
         24        BW_AND                                           ~11     $9, $10
         25        CONCAT                                           ~12     ~11, '%0A'
         26        ECHO                                                     ~12
   13    27        INIT_FCALL                                               'ip2long'
         28        SEND_VAR                                                 !0
         29        DO_ICALL                                         $13     
         30        INIT_FCALL                                               'ip2long'
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                         $14     
         33        BW_AND                                           ~15     $13, $14
         34        INIT_FCALL                                               'ip2long'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                         $16     
         37        IS_EQUAL                                                 $16, ~15
         38      > JMPZ                                                     ~17, ->41
   14    39    > > RETURN                                                   1
         40*       JMP                                                      ->42
   16    41    > > RETURN                                                   0
   18    42*     > RETURN                                                   null

End of function ip_vs_net

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.41 ms | 1400 KiB | 15 Q