3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cidrlist($cidr) { $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)){ array_push($ips,$ip); } $fip++; } return $ips; } $nblock = cidrlist('0.0.0.0/0'); print_r($nblock);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/E18gU
function name:  (null)
number of ops:  8
compiled vars:  !0 = $nblock
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'cidrlist'
          1        SEND_VAL                                                 '0.0.0.0%2F0'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
   21     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function cidrlist:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 52
Branch analysis from position: 69
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 66
Branch analysis from position: 62
2 jumps found. (Code = 44) Position 1 = 69, Position 2 = 52
Branch analysis from position: 69
Branch analysis from position: 52
Branch analysis from position: 66
filename:       /in/E18gU
function name:  cidrlist
number of ops:  71
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 >   RECV                                             !0      
    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                                         $8      
          7        ASSIGN                                                   !0, $8
    6     8        INIT_FCALL                                               'long2ip'
          9        INIT_FCALL                                               'ip2long'
         10        FETCH_DIM_R                                      ~11     !0, 0
         11        SEND_VAL                                                 ~11
         12        DO_ICALL                                         $12     
         13        FETCH_DIM_R                                      ~13     !0, 1
         14        CAST                                          4  ~14     ~13
         15        SUB                                              ~15     32, ~14
         16        SL                                               ~16     -1, ~15
         17        BW_AND                                           ~17     $12, ~16
         18        SEND_VAL                                                 ~17
         19        DO_ICALL                                         $18     
         20        ASSIGN_DIM                                               !1, 0
         21        OP_DATA                                                  $18
    7    22        INIT_FCALL                                               'long2ip'
         23        INIT_FCALL                                               'ip2long'
         24        FETCH_DIM_R                                      ~20     !0, 0
         25        SEND_VAL                                                 ~20
         26        DO_ICALL                                         $21     
         27        INIT_FCALL                                               'pow'
         28        SEND_VAL                                                 2
         29        FETCH_DIM_R                                      ~22     !0, 1
         30        CAST                                          4  ~23     ~22
         31        SUB                                              ~24     32, ~23
         32        SEND_VAL                                                 ~24
         33        DO_ICALL                                         $25     
         34        ADD                                              ~26     $21, $25
         35        SUB                                              ~27     ~26, 1
         36        SEND_VAL                                                 ~27
         37        DO_ICALL                                         $28     
         38        ASSIGN_DIM                                               !1, 1
         39        OP_DATA                                                  $28
    8    40        INIT_FCALL                                               'ip2long'
         41        FETCH_DIM_R                                      ~29     !1, 0
         42        SEND_VAL                                                 ~29
         43        DO_ICALL                                         $30     
         44        ASSIGN                                                   !3, $30
    9    45        INIT_FCALL                                               'ip2long'
         46        FETCH_DIM_R                                      ~32     !1, 1
         47        SEND_VAL                                                 ~32
         48        DO_ICALL                                         $33     
         49        ASSIGN                                                   !4, $33
   10    50        PRE_INC                                                  !3
   11    51      > JMP                                                      ->67
   12    52    >   INIT_FCALL                                               'long2ip'
         53        SEND_VAR                                                 !3
         54        DO_ICALL                                         $36     
         55        ASSIGN                                                   !5, $36
   13    56        INIT_FCALL                                               'preg_match'
         57        SEND_VAL                                                 '%2F%5C.0%24%2F'
         58        SEND_VAR                                                 !5
         59        DO_ICALL                                         $38     
         60        BOOL_NOT                                         ~39     $38
         61      > JMPZ                                                     ~39, ->66
   14    62    >   INIT_FCALL                                               'array_push'
         63        SEND_REF                                                 !2
         64        SEND_VAR                                                 !5
         65        DO_ICALL                                                 
   16    66    >   PRE_INC                                                  !3
   11    67    >   IS_SMALLER                                               !3, !4
         68      > JMPNZ                                                    ~42, ->52
   18    69    > > RETURN                                                   !2
   19    70*     > RETURN                                                   null

End of function cidrlist

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.47 ms | 1394 KiB | 28 Q