3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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) ); } print_r(ipListFromRange($range));
Output for 7.1.0
Notice: A non well formed numeric value encountered in /in/Wl3XG on line 8 Array ( [0] => 194.8.50.0 [1] => 194.8.50.1 [2] => 194.8.50.2 [3] => 194.8.50.3 [4] => 194.8.50.4 [5] => 194.8.50.5 [6] => 194.8.50.6 [7] => 194.8.50.7 [8] => 194.8.50.8 [9] => 194.8.50.9 [10] => 194.8.50.10 [11] => 194.8.50.11 [12] => 194.8.50.12 [13] => 194.8.50.13 [14] => 194.8.50.14 [15] => 194.8.50.15 [16] => 194.8.50.16 [17] => 194.8.50.17 [18] => 194.8.50.18 [19] => 194.8.50.19 [20] => 194.8.50.20 [21] => 194.8.50.21 [22] => 194.8.50.22 [23] => 194.8.50.23 [24] => 194.8.50.24 [25] => 194.8.50.25 [26] => 194.8.50.26 [27] => 194.8.50.27 [28] => 194.8.50.28 [29] => 194.8.50.29 [30] => 194.8.50.30 [31] => 194.8.50.31 [32] => 194.8.50.32 [33] => 194.8.50.33 [34] => 194.8.50.34 [35] => 194.8.50.35 [36] => 194.8.50.36 [37] => 194.8.50.37 [38] => 194.8.50.38 [39] => 194.8.50.39 [40] => 194.8.50.40 [41] => 194.8.50.41 [42] => 194.8.50.42 [43] => 194.8.50.43 [44] => 194.8.50.44 [45] => 194.8.50.45 [46] => 194.8.50.46 [47] => 194.8.50.47 [48] => 194.8.50.48 [49] => 194.8.50.49 [50] => 194.8.50.50 [51] => 194.8.50.51 [52] => 194.8.50.52 [53] => 194.8.50.53 [54] => 194.8.50.54 [55] => 194.8.50.55 [56] => 194.8.50.56 [57] => 194.8.50.57 [58] => 194.8.50.58 [59] => 194.8.50.59 [60] => 194.8.50.60 [61] => 194.8.50.61 [62] => 194.8.50.62 [63] => 194.8.50.63 [64] => 194.8.50.64 [65] => 194.8.50.65 [66] => 194.8.50.66 [67] => 194.8.50.67 [68] => 194.8.50.68 [69] => 194.8.50.69 [70] => 194.8.50.70 [71] => 194.8.50.71 [72] => 194.8.50.72 [73] => 194.8.50.73 [74] => 194.8.50.74 [75] => 194.8.50.75 [76] => 194.8.50.76 [77] => 194.8.50.77 [78] => 194.8.50.78 [79] => 194.8.50.79 [80] => 194.8.50.80 [81] => 194.8.50.81 [82] => 194.8.50.82 [83] => 194.8.50.83 [84] => 194.8.50.84 [85] => 194.8.50.85 [86] => 194.8.50.86 [87] => 194.8.50.87 [88] => 194.8.50.88 [89] => 194.8.50.89 [90] => 194.8.50.90 [91] => 194.8.50.91 [92] => 194.8.50.92 [93] => 194.8.50.93 [94] => 194.8.50.94 [95] => 194.8.50.95 [96] => 194.8.50.96 [97] => 194.8.50.97 [98] => 194.8.50.98 [99] => 194.8.50.99 [100] => 194.8.50.100 [101] => 194.8.50.101 [102] => 194.8.50.102 [103] => 194.8.50.103 [104] => 194.8.50.104 [105] => 194.8.50.105 [106] => 194.8.50.106 [107] => 194.8.50.107 [108] => 194.8.50.108 [109] => 194.8.50.109 [110] => 194.8.50.110 [111] => 194.8.50.111 [112] => 194.8.50.112 [113] => 194.8.50.113 [114] => 194.8.50.114 [115] => 194.8.50.115 [116] => 194.8.50.116 [117] => 194.8.50.117 [118] => 194.8.50.118 [119] => 194.8.50.119 [120] => 194.8.50.120 [121] => 194.8.50.121 [122] => 194.8.50.122 [123] => 194.8.50.123 [124] => 194.8.50.124 [125] => 194.8.50.125 [126] => 194.8.50.126 [127] => 194.8.50.127 [128] => 194.8.50.128 [129] => 194.8.50.129 [130] => 194.8.50.130 [131] => 194.8.50.131 [132] => 194.8.50.132 [133] => 194.8.50.133 [134] => 194.8.50.134 [135] => 194.8.50.135 [136] => 194.8.50.136 [137] => 194.8.50.137 [138] => 194.8.50.138 [139] => 194.8.50.139 [140] => 194.8.50.140 [141] => 194.8.50.141 [142] => 194.8.50.142 [143] => 194.8.50.143 [144] => 194.8.50.144 [145] => 194.8.50.145 [146] => 194.8.50.146 [147] => 194.8.50.147 [148] => 194.8.50.148 [149] => 194.8.50.149 [150] => 194.8.50.150 [151] => 194.8.50.151 [152] => 194.8.50.152 [153] => 194.8.50.153 [154] => 194.8.50.154 [155] => 194.8.50.155 [156] => 194.8.50.156 [157] => 194.8.50.157 [158] => 194.8.50.158 [159] => 194.8.50.159 [160] => 194.8.50.160 [161] => 194.8.50.161 [162] => 194.8.50.162 [163] => 194.8.50.163 [164] => 194.8.50.164 [165] => 194.8.50.165 [166] => 194.8.50.166 [167] => 194.8.50.167 [168] => 194.8.50.168 [169] => 194.8.50.169 [170] => 194.8.50.170 [171] => 194.8.50.171 [172] => 194.8.50.172 [173] => 194.8.50.173 [174] => 194.8.50.174 [175] => 194.8.50.175 [176] => 194.8.50.176 [177] => 194.8.50.177 [178] => 194.8.50.178 [179] => 194.8.50.179 [180] => 194.8.50.180 [181] => 194.8.50.181 [182] => 194.8.50.182 [183] => 194.8.50.183 [184] => 194.8.50.184 [185] => 194.8.50.185 [186] => 194.8.50.186 [187] => 194.8.50.187 [188] => 194.8.50.188 [189] => 194.8.50.189 [190] => 194.8.50.190 [191] => 194.8.50.191 [192] => 194.8.50.192 [193] => 194.8.50.193 [194] => 194.8.50.194 [195] => 194.8.50.195 [196] => 194.8.50.196 [197] => 194.8.50.197 [198] => 194.8.50.198 [199] => 194.8.50.199 [200] => 194.8.50.200 [201] => 194.8.50.201 [202] => 194.8.50.202 [203] => 194.8.50.203 [204] => 194.8.50.204 [205] => 194.8.50.205 [206] => 194.8.50.206 [207] => 194.8.50.207 [208] => 194.8.50.208 [209] => 194.8.50.209 [210] => 194.8.50.210 [211] => 194.8.50.211 [212] => 194.8.50.212 [213] => 194.8.50.213 [214] => 194.8.50.214 [215] => 194.8.50.215 [216] => 194.8.50.216 [217] => 194.8.50.217 [218] => 194.8.50.218 [219] => 194.8.50.219 [220] => 194.8.50.220 [221] => 194.8.50.221 [222] => 194.8.50.222 [223] => 194.8.50.223 [224] => 194.8.50.224 [225] => 194.8.50.225 [226] => 194.8.50.226 [227] => 194.8.50.227 [228] => 194.8.50.228 [229] => 194.8.50.229 [230] => 194.8.50.230 [231] => 194.8.50.231 [232] => 194.8.50.232 [233] => 194.8.50.233 [234] => 194.8.50.234 [235] => 194.8.50.235 [236] => 194.8.50.236 [237] => 194.8.50.237 [238] => 194.8.50.238 [239] => 194.8.50.239 [240] => 194.8.50.240 [241] => 194.8.50.241 [242] => 194.8.50.242 [243] => 194.8.50.243 [244] => 194.8.50.244 [245] => 194.8.50.245 [246] => 194.8.50.246 [247] => 194.8.50.247 [248] => 194.8.50.248 [249] => 194.8.50.249 [250] => 194.8.50.250 [251] => 194.8.50.251 [252] => 194.8.50.252 [253] => 194.8.50.253 [254] => 194.8.50.254 [255] => 194.8.50.255 [256] => 194.8.51.0 )
Output for 4.3.0 - 5.6.28, 7.0.0 - 7.0.14
Array ( [0] => 194.8.50.0 [1] => 194.8.50.1 [2] => 194.8.50.2 [3] => 194.8.50.3 [4] => 194.8.50.4 [5] => 194.8.50.5 [6] => 194.8.50.6 [7] => 194.8.50.7 [8] => 194.8.50.8 [9] => 194.8.50.9 [10] => 194.8.50.10 [11] => 194.8.50.11 [12] => 194.8.50.12 [13] => 194.8.50.13 [14] => 194.8.50.14 [15] => 194.8.50.15 [16] => 194.8.50.16 [17] => 194.8.50.17 [18] => 194.8.50.18 [19] => 194.8.50.19 [20] => 194.8.50.20 [21] => 194.8.50.21 [22] => 194.8.50.22 [23] => 194.8.50.23 [24] => 194.8.50.24 [25] => 194.8.50.25 [26] => 194.8.50.26 [27] => 194.8.50.27 [28] => 194.8.50.28 [29] => 194.8.50.29 [30] => 194.8.50.30 [31] => 194.8.50.31 [32] => 194.8.50.32 [33] => 194.8.50.33 [34] => 194.8.50.34 [35] => 194.8.50.35 [36] => 194.8.50.36 [37] => 194.8.50.37 [38] => 194.8.50.38 [39] => 194.8.50.39 [40] => 194.8.50.40 [41] => 194.8.50.41 [42] => 194.8.50.42 [43] => 194.8.50.43 [44] => 194.8.50.44 [45] => 194.8.50.45 [46] => 194.8.50.46 [47] => 194.8.50.47 [48] => 194.8.50.48 [49] => 194.8.50.49 [50] => 194.8.50.50 [51] => 194.8.50.51 [52] => 194.8.50.52 [53] => 194.8.50.53 [54] => 194.8.50.54 [55] => 194.8.50.55 [56] => 194.8.50.56 [57] => 194.8.50.57 [58] => 194.8.50.58 [59] => 194.8.50.59 [60] => 194.8.50.60 [61] => 194.8.50.61 [62] => 194.8.50.62 [63] => 194.8.50.63 [64] => 194.8.50.64 [65] => 194.8.50.65 [66] => 194.8.50.66 [67] => 194.8.50.67 [68] => 194.8.50.68 [69] => 194.8.50.69 [70] => 194.8.50.70 [71] => 194.8.50.71 [72] => 194.8.50.72 [73] => 194.8.50.73 [74] => 194.8.50.74 [75] => 194.8.50.75 [76] => 194.8.50.76 [77] => 194.8.50.77 [78] => 194.8.50.78 [79] => 194.8.50.79 [80] => 194.8.50.80 [81] => 194.8.50.81 [82] => 194.8.50.82 [83] => 194.8.50.83 [84] => 194.8.50.84 [85] => 194.8.50.85 [86] => 194.8.50.86 [87] => 194.8.50.87 [88] => 194.8.50.88 [89] => 194.8.50.89 [90] => 194.8.50.90 [91] => 194.8.50.91 [92] => 194.8.50.92 [93] => 194.8.50.93 [94] => 194.8.50.94 [95] => 194.8.50.95 [96] => 194.8.50.96 [97] => 194.8.50.97 [98] => 194.8.50.98 [99] => 194.8.50.99 [100] => 194.8.50.100 [101] => 194.8.50.101 [102] => 194.8.50.102 [103] => 194.8.50.103 [104] => 194.8.50.104 [105] => 194.8.50.105 [106] => 194.8.50.106 [107] => 194.8.50.107 [108] => 194.8.50.108 [109] => 194.8.50.109 [110] => 194.8.50.110 [111] => 194.8.50.111 [112] => 194.8.50.112 [113] => 194.8.50.113 [114] => 194.8.50.114 [115] => 194.8.50.115 [116] => 194.8.50.116 [117] => 194.8.50.117 [118] => 194.8.50.118 [119] => 194.8.50.119 [120] => 194.8.50.120 [121] => 194.8.50.121 [122] => 194.8.50.122 [123] => 194.8.50.123 [124] => 194.8.50.124 [125] => 194.8.50.125 [126] => 194.8.50.126 [127] => 194.8.50.127 [128] => 194.8.50.128 [129] => 194.8.50.129 [130] => 194.8.50.130 [131] => 194.8.50.131 [132] => 194.8.50.132 [133] => 194.8.50.133 [134] => 194.8.50.134 [135] => 194.8.50.135 [136] => 194.8.50.136 [137] => 194.8.50.137 [138] => 194.8.50.138 [139] => 194.8.50.139 [140] => 194.8.50.140 [141] => 194.8.50.141 [142] => 194.8.50.142 [143] => 194.8.50.143 [144] => 194.8.50.144 [145] => 194.8.50.145 [146] => 194.8.50.146 [147] => 194.8.50.147 [148] => 194.8.50.148 [149] => 194.8.50.149 [150] => 194.8.50.150 [151] => 194.8.50.151 [152] => 194.8.50.152 [153] => 194.8.50.153 [154] => 194.8.50.154 [155] => 194.8.50.155 [156] => 194.8.50.156 [157] => 194.8.50.157 [158] => 194.8.50.158 [159] => 194.8.50.159 [160] => 194.8.50.160 [161] => 194.8.50.161 [162] => 194.8.50.162 [163] => 194.8.50.163 [164] => 194.8.50.164 [165] => 194.8.50.165 [166] => 194.8.50.166 [167] => 194.8.50.167 [168] => 194.8.50.168 [169] => 194.8.50.169 [170] => 194.8.50.170 [171] => 194.8.50.171 [172] => 194.8.50.172 [173] => 194.8.50.173 [174] => 194.8.50.174 [175] => 194.8.50.175 [176] => 194.8.50.176 [177] => 194.8.50.177 [178] => 194.8.50.178 [179] => 194.8.50.179 [180] => 194.8.50.180 [181] => 194.8.50.181 [182] => 194.8.50.182 [183] => 194.8.50.183 [184] => 194.8.50.184 [185] => 194.8.50.185 [186] => 194.8.50.186 [187] => 194.8.50.187 [188] => 194.8.50.188 [189] => 194.8.50.189 [190] => 194.8.50.190 [191] => 194.8.50.191 [192] => 194.8.50.192 [193] => 194.8.50.193 [194] => 194.8.50.194 [195] => 194.8.50.195 [196] => 194.8.50.196 [197] => 194.8.50.197 [198] => 194.8.50.198 [199] => 194.8.50.199 [200] => 194.8.50.200 [201] => 194.8.50.201 [202] => 194.8.50.202 [203] => 194.8.50.203 [204] => 194.8.50.204 [205] => 194.8.50.205 [206] => 194.8.50.206 [207] => 194.8.50.207 [208] => 194.8.50.208 [209] => 194.8.50.209 [210] => 194.8.50.210 [211] => 194.8.50.211 [212] => 194.8.50.212 [213] => 194.8.50.213 [214] => 194.8.50.214 [215] => 194.8.50.215 [216] => 194.8.50.216 [217] => 194.8.50.217 [218] => 194.8.50.218 [219] => 194.8.50.219 [220] => 194.8.50.220 [221] => 194.8.50.221 [222] => 194.8.50.222 [223] => 194.8.50.223 [224] => 194.8.50.224 [225] => 194.8.50.225 [226] => 194.8.50.226 [227] => 194.8.50.227 [228] => 194.8.50.228 [229] => 194.8.50.229 [230] => 194.8.50.230 [231] => 194.8.50.231 [232] => 194.8.50.232 [233] => 194.8.50.233 [234] => 194.8.50.234 [235] => 194.8.50.235 [236] => 194.8.50.236 [237] => 194.8.50.237 [238] => 194.8.50.238 [239] => 194.8.50.239 [240] => 194.8.50.240 [241] => 194.8.50.241 [242] => 194.8.50.242 [243] => 194.8.50.243 [244] => 194.8.50.244 [245] => 194.8.50.245 [246] => 194.8.50.246 [247] => 194.8.50.247 [248] => 194.8.50.248 [249] => 194.8.50.249 [250] => 194.8.50.250 [251] => 194.8.50.251 [252] => 194.8.50.252 [253] => 194.8.50.253 [254] => 194.8.50.254 [255] => 194.8.50.255 [256] => 194.8.51.0 )
Output for hhvm-3.10.0 - 3.12.0
Array ( [0] => 194.8.50.0 [1] => 194.8.50.1 )