3v4l.org

run code in 300+ PHP versions simultaneously
<?php $range = "194.8.50.0/24"; function ipListFromRange($range){ $parts = explode('/',$range); $exponent = 32-$parts[1].'-'; $count = pow(2,$exponent); $start = ip2long($parts[0]); $end = $start+$count; return array_map('long2ip', range($start, $end-1) ); } print_r(ipListFromRange($range));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6gvu8
function name:  (null)
number of ops:  8
compiled vars:  !0 = $range
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '194.8.50.0%2F24'
   14     1        INIT_FCALL                                               'print_r'
          2        INIT_FCALL                                               'iplistfromrange'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $2      
          5        SEND_VAR                                                 $2
          6        DO_ICALL                                                 
          7      > RETURN                                                   1

Function iplistfromrange:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6gvu8
function name:  ipListFromRange
number of ops:  33
compiled vars:  !0 = $range, !1 = $parts, !2 = $exponent, !3 = $count, !4 = $start, !5 = $end
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    7     6        FETCH_DIM_R                                      ~8      !1, 1
          7        SUB                                              ~9      32, ~8
          8        CONCAT                                           ~10     ~9, '-'
          9        ASSIGN                                                   !2, ~10
    8    10        INIT_FCALL                                               'pow'
         11        SEND_VAL                                                 2
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $12     
         14        ASSIGN                                                   !3, $12
    9    15        INIT_FCALL                                               'ip2long'
         16        FETCH_DIM_R                                      ~14     !1, 0
         17        SEND_VAL                                                 ~14
         18        DO_ICALL                                         $15     
         19        ASSIGN                                                   !4, $15
   10    20        ADD                                              ~17     !4, !3
         21        ASSIGN                                                   !5, ~17
   11    22        INIT_FCALL                                               'array_map'
         23        SEND_VAL                                                 'long2ip'
         24        INIT_FCALL                                               'range'
         25        SEND_VAR                                                 !4
         26        SUB                                              ~19     !5, 1
         27        SEND_VAL                                                 ~19
         28        DO_ICALL                                         $20     
         29        SEND_VAR                                                 $20
         30        DO_ICALL                                         $21     
         31      > RETURN                                                   $21
   12    32*     > RETURN                                                   null

End of function iplistfromrange

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.22 ms | 1403 KiB | 26 Q