3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cidr='127.0.0.1/20'; $rge = array(); $ips = array(); $cidr = explode('/', $cidr); $rge[0] = long2ip((ip2long($cidr[0])) & ((-1 << (32 - (int)$cidr[1])))); $rge[1] = long2ip((ip2long($cidr[0])) + pow(2, (32 - (int)$cidr[1])) - 1); $fip = ip2long($rge[0]); $lip = ip2long($rge[1]); $fip++; while($fip < $lip){ $ip = long2ip($fip); if(!preg_match('/\.0$/',$ip)){ echo "$ip\n"; } $fip++; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
2 jumps found. (Code = 44) Position 1 = 68, Position 2 = 52
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 65
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 68, Position 2 = 52
Branch analysis from position: 68
Branch analysis from position: 52
Branch analysis from position: 65
filename:       /in/IDbiY
function name:  (null)
number of ops:  69
compiled vars:  !0 = $cidr, !1 = $rge, !2 = $ips, !3 = $fip, !4 = $lip, !5 = $ip
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '127.0.0.1%2F20'
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%2F'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !0, $9
    6     8        INIT_FCALL                                               'long2ip'
          9        INIT_FCALL                                               'ip2long'
         10        FETCH_DIM_R                                      ~12     !0, 0
         11        SEND_VAL                                                 ~12
         12        DO_ICALL                                         $13     
         13        FETCH_DIM_R                                      ~14     !0, 1
         14        CAST                                          4  ~15     ~14
         15        SUB                                              ~16     32, ~15
         16        SL                                               ~17     -1, ~16
         17        BW_AND                                           ~18     $13, ~17
         18        SEND_VAL                                                 ~18
         19        DO_ICALL                                         $19     
         20        ASSIGN_DIM                                               !1, 0
         21        OP_DATA                                                  $19
    7    22        INIT_FCALL                                               'long2ip'
         23        INIT_FCALL                                               'ip2long'
         24        FETCH_DIM_R                                      ~21     !0, 0
         25        SEND_VAL                                                 ~21
         26        DO_ICALL                                         $22     
         27        INIT_FCALL                                               'pow'
         28        SEND_VAL                                                 2
         29        FETCH_DIM_R                                      ~23     !0, 1
         30        CAST                                          4  ~24     ~23
         31        SUB                                              ~25     32, ~24
         32        SEND_VAL                                                 ~25
         33        DO_ICALL                                         $26     
         34        ADD                                              ~27     $22, $26
         35        SUB                                              ~28     ~27, 1
         36        SEND_VAL                                                 ~28
         37        DO_ICALL                                         $29     
         38        ASSIGN_DIM                                               !1, 1
         39        OP_DATA                                                  $29
    8    40        INIT_FCALL                                               'ip2long'
         41        FETCH_DIM_R                                      ~30     !1, 0
         42        SEND_VAL                                                 ~30
         43        DO_ICALL                                         $31     
         44        ASSIGN                                                   !3, $31
    9    45        INIT_FCALL                                               'ip2long'
         46        FETCH_DIM_R                                      ~33     !1, 1
         47        SEND_VAL                                                 ~33
         48        DO_ICALL                                         $34     
         49        ASSIGN                                                   !4, $34
   10    50        PRE_INC                                                  !3
   11    51      > JMP                                                      ->66
   12    52    >   INIT_FCALL                                               'long2ip'
         53        SEND_VAR                                                 !3
         54        DO_ICALL                                         $37     
         55        ASSIGN                                                   !5, $37
   13    56        INIT_FCALL                                               'preg_match'
         57        SEND_VAL                                                 '%2F%5C.0%24%2F'
         58        SEND_VAR                                                 !5
         59        DO_ICALL                                         $39     
         60        BOOL_NOT                                         ~40     $39
         61      > JMPZ                                                     ~40, ->65
   14    62    >   NOP                                                      
         63        FAST_CONCAT                                      ~41     !5, '%0A'
         64        ECHO                                                     ~41
   16    65    >   PRE_INC                                                  !3
   11    66    >   IS_SMALLER                                               !3, !4
         67      > JMPNZ                                                    ~43, ->52
   17    68    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.23 ms | 1400 KiB | 23 Q