3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $range = "194.8.42.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));
Output for 7.1.0RC3 - 7.1.0
Notice: A non well formed numeric value encountered in /in/T8GHv on line 8 Array ( [0] => 194.8.42.0 [1] => 194.8.42.1 [2] => 194.8.42.2 [3] => 194.8.42.3 [4] => 194.8.42.4 [5] => 194.8.42.5 [6] => 194.8.42.6 [7] => 194.8.42.7 [8] => 194.8.42.8 [9] => 194.8.42.9 [10] => 194.8.42.10 [11] => 194.8.42.11 [12] => 194.8.42.12 [13] => 194.8.42.13 [14] => 194.8.42.14 [15] => 194.8.42.15 [16] => 194.8.42.16 [17] => 194.8.42.17 [18] => 194.8.42.18 [19] => 194.8.42.19 [20] => 194.8.42.20 [21] => 194.8.42.21 [22] => 194.8.42.22 [23] => 194.8.42.23 [24] => 194.8.42.24 [25] => 194.8.42.25 [26] => 194.8.42.26 [27] => 194.8.42.27 [28] => 194.8.42.28 [29] => 194.8.42.29 [30] => 194.8.42.30 [31] => 194.8.42.31 [32] => 194.8.42.32 [33] => 194.8.42.33 [34] => 194.8.42.34 [35] => 194.8.42.35 [36] => 194.8.42.36 [37] => 194.8.42.37 [38] => 194.8.42.38 [39] => 194.8.42.39 [40] => 194.8.42.40 [41] => 194.8.42.41 [42] => 194.8.42.42 [43] => 194.8.42.43 [44] => 194.8.42.44 [45] => 194.8.42.45 [46] => 194.8.42.46 [47] => 194.8.42.47 [48] => 194.8.42.48 [49] => 194.8.42.49 [50] => 194.8.42.50 [51] => 194.8.42.51 [52] => 194.8.42.52 [53] => 194.8.42.53 [54] => 194.8.42.54 [55] => 194.8.42.55 [56] => 194.8.42.56 [57] => 194.8.42.57 [58] => 194.8.42.58 [59] => 194.8.42.59 [60] => 194.8.42.60 [61] => 194.8.42.61 [62] => 194.8.42.62 [63] => 194.8.42.63 [64] => 194.8.42.64 [65] => 194.8.42.65 [66] => 194.8.42.66 [67] => 194.8.42.67 [68] => 194.8.42.68 [69] => 194.8.42.69 [70] => 194.8.42.70 [71] => 194.8.42.71 [72] => 194.8.42.72 [73] => 194.8.42.73 [74] => 194.8.42.74 [75] => 194.8.42.75 [76] => 194.8.42.76 [77] => 194.8.42.77 [78] => 194.8.42.78 [79] => 194.8.42.79 [80] => 194.8.42.80 [81] => 194.8.42.81 [82] => 194.8.42.82 [83] => 194.8.42.83 [84] => 194.8.42.84 [85] => 194.8.42.85 [86] => 194.8.42.86 [87] => 194.8.42.87 [88] => 194.8.42.88 [89] => 194.8.42.89 [90] => 194.8.42.90 [91] => 194.8.42.91 [92] => 194.8.42.92 [93] => 194.8.42.93 [94] => 194.8.42.94 [95] => 194.8.42.95 [96] => 194.8.42.96 [97] => 194.8.42.97 [98] => 194.8.42.98 [99] => 194.8.42.99 [100] => 194.8.42.100 [101] => 194.8.42.101 [102] => 194.8.42.102 [103] => 194.8.42.103 [104] => 194.8.42.104 [105] => 194.8.42.105 [106] => 194.8.42.106 [107] => 194.8.42.107 [108] => 194.8.42.108 [109] => 194.8.42.109 [110] => 194.8.42.110 [111] => 194.8.42.111 [112] => 194.8.42.112 [113] => 194.8.42.113 [114] => 194.8.42.114 [115] => 194.8.42.115 [116] => 194.8.42.116 [117] => 194.8.42.117 [118] => 194.8.42.118 [119] => 194.8.42.119 [120] => 194.8.42.120 [121] => 194.8.42.121 [122] => 194.8.42.122 [123] => 194.8.42.123 [124] => 194.8.42.124 [125] => 194.8.42.125 [126] => 194.8.42.126 [127] => 194.8.42.127 [128] => 194.8.42.128 [129] => 194.8.42.129 [130] => 194.8.42.130 [131] => 194.8.42.131 [132] => 194.8.42.132 [133] => 194.8.42.133 [134] => 194.8.42.134 [135] => 194.8.42.135 [136] => 194.8.42.136 [137] => 194.8.42.137 [138] => 194.8.42.138 [139] => 194.8.42.139 [140] => 194.8.42.140 [141] => 194.8.42.141 [142] => 194.8.42.142 [143] => 194.8.42.143 [144] => 194.8.42.144 [145] => 194.8.42.145 [146] => 194.8.42.146 [147] => 194.8.42.147 [148] => 194.8.42.148 [149] => 194.8.42.149 [150] => 194.8.42.150 [151] => 194.8.42.151 [152] => 194.8.42.152 [153] => 194.8.42.153 [154] => 194.8.42.154 [155] => 194.8.42.155 [156] => 194.8.42.156 [157] => 194.8.42.157 [158] => 194.8.42.158 [159] => 194.8.42.159 [160] => 194.8.42.160 [161] => 194.8.42.161 [162] => 194.8.42.162 [163] => 194.8.42.163 [164] => 194.8.42.164 [165] => 194.8.42.165 [166] => 194.8.42.166 [167] => 194.8.42.167 [168] => 194.8.42.168 [169] => 194.8.42.169 [170] => 194.8.42.170 [171] => 194.8.42.171 [172] => 194.8.42.172 [173] => 194.8.42.173 [174] => 194.8.42.174 [175] => 194.8.42.175 [176] => 194.8.42.176 [177] => 194.8.42.177 [178] => 194.8.42.178 [179] => 194.8.42.179 [180] => 194.8.42.180 [181] => 194.8.42.181 [182] => 194.8.42.182 [183] => 194.8.42.183 [184] => 194.8.42.184 [185] => 194.8.42.185 [186] => 194.8.42.186 [187] => 194.8.42.187 [188] => 194.8.42.188 [189] => 194.8.42.189 [190] => 194.8.42.190 [191] => 194.8.42.191 [192] => 194.8.42.192 [193] => 194.8.42.193 [194] => 194.8.42.194 [195] => 194.8.42.195 [196] => 194.8.42.196 [197] => 194.8.42.197 [198] => 194.8.42.198 [199] => 194.8.42.199 [200] => 194.8.42.200 [201] => 194.8.42.201 [202] => 194.8.42.202 [203] => 194.8.42.203 [204] => 194.8.42.204 [205] => 194.8.42.205 [206] => 194.8.42.206 [207] => 194.8.42.207 [208] => 194.8.42.208 [209] => 194.8.42.209 [210] => 194.8.42.210 [211] => 194.8.42.211 [212] => 194.8.42.212 [213] => 194.8.42.213 [214] => 194.8.42.214 [215] => 194.8.42.215 [216] => 194.8.42.216 [217] => 194.8.42.217 [218] => 194.8.42.218 [219] => 194.8.42.219 [220] => 194.8.42.220 [221] => 194.8.42.221 [222] => 194.8.42.222 [223] => 194.8.42.223 [224] => 194.8.42.224 [225] => 194.8.42.225 [226] => 194.8.42.226 [227] => 194.8.42.227 [228] => 194.8.42.228 [229] => 194.8.42.229 [230] => 194.8.42.230 [231] => 194.8.42.231 [232] => 194.8.42.232 [233] => 194.8.42.233 [234] => 194.8.42.234 [235] => 194.8.42.235 [236] => 194.8.42.236 [237] => 194.8.42.237 [238] => 194.8.42.238 [239] => 194.8.42.239 [240] => 194.8.42.240 [241] => 194.8.42.241 [242] => 194.8.42.242 [243] => 194.8.42.243 [244] => 194.8.42.244 [245] => 194.8.42.245 [246] => 194.8.42.246 [247] => 194.8.42.247 [248] => 194.8.42.248 [249] => 194.8.42.249 [250] => 194.8.42.250 [251] => 194.8.42.251 [252] => 194.8.42.252 [253] => 194.8.42.253 [254] => 194.8.42.254 [255] => 194.8.42.255 )
Output for 4.3.0 - 5.6.21, 7.0.0 - 7.0.6
Array ( [0] => 194.8.42.0 [1] => 194.8.42.1 [2] => 194.8.42.2 [3] => 194.8.42.3 [4] => 194.8.42.4 [5] => 194.8.42.5 [6] => 194.8.42.6 [7] => 194.8.42.7 [8] => 194.8.42.8 [9] => 194.8.42.9 [10] => 194.8.42.10 [11] => 194.8.42.11 [12] => 194.8.42.12 [13] => 194.8.42.13 [14] => 194.8.42.14 [15] => 194.8.42.15 [16] => 194.8.42.16 [17] => 194.8.42.17 [18] => 194.8.42.18 [19] => 194.8.42.19 [20] => 194.8.42.20 [21] => 194.8.42.21 [22] => 194.8.42.22 [23] => 194.8.42.23 [24] => 194.8.42.24 [25] => 194.8.42.25 [26] => 194.8.42.26 [27] => 194.8.42.27 [28] => 194.8.42.28 [29] => 194.8.42.29 [30] => 194.8.42.30 [31] => 194.8.42.31 [32] => 194.8.42.32 [33] => 194.8.42.33 [34] => 194.8.42.34 [35] => 194.8.42.35 [36] => 194.8.42.36 [37] => 194.8.42.37 [38] => 194.8.42.38 [39] => 194.8.42.39 [40] => 194.8.42.40 [41] => 194.8.42.41 [42] => 194.8.42.42 [43] => 194.8.42.43 [44] => 194.8.42.44 [45] => 194.8.42.45 [46] => 194.8.42.46 [47] => 194.8.42.47 [48] => 194.8.42.48 [49] => 194.8.42.49 [50] => 194.8.42.50 [51] => 194.8.42.51 [52] => 194.8.42.52 [53] => 194.8.42.53 [54] => 194.8.42.54 [55] => 194.8.42.55 [56] => 194.8.42.56 [57] => 194.8.42.57 [58] => 194.8.42.58 [59] => 194.8.42.59 [60] => 194.8.42.60 [61] => 194.8.42.61 [62] => 194.8.42.62 [63] => 194.8.42.63 [64] => 194.8.42.64 [65] => 194.8.42.65 [66] => 194.8.42.66 [67] => 194.8.42.67 [68] => 194.8.42.68 [69] => 194.8.42.69 [70] => 194.8.42.70 [71] => 194.8.42.71 [72] => 194.8.42.72 [73] => 194.8.42.73 [74] => 194.8.42.74 [75] => 194.8.42.75 [76] => 194.8.42.76 [77] => 194.8.42.77 [78] => 194.8.42.78 [79] => 194.8.42.79 [80] => 194.8.42.80 [81] => 194.8.42.81 [82] => 194.8.42.82 [83] => 194.8.42.83 [84] => 194.8.42.84 [85] => 194.8.42.85 [86] => 194.8.42.86 [87] => 194.8.42.87 [88] => 194.8.42.88 [89] => 194.8.42.89 [90] => 194.8.42.90 [91] => 194.8.42.91 [92] => 194.8.42.92 [93] => 194.8.42.93 [94] => 194.8.42.94 [95] => 194.8.42.95 [96] => 194.8.42.96 [97] => 194.8.42.97 [98] => 194.8.42.98 [99] => 194.8.42.99 [100] => 194.8.42.100 [101] => 194.8.42.101 [102] => 194.8.42.102 [103] => 194.8.42.103 [104] => 194.8.42.104 [105] => 194.8.42.105 [106] => 194.8.42.106 [107] => 194.8.42.107 [108] => 194.8.42.108 [109] => 194.8.42.109 [110] => 194.8.42.110 [111] => 194.8.42.111 [112] => 194.8.42.112 [113] => 194.8.42.113 [114] => 194.8.42.114 [115] => 194.8.42.115 [116] => 194.8.42.116 [117] => 194.8.42.117 [118] => 194.8.42.118 [119] => 194.8.42.119 [120] => 194.8.42.120 [121] => 194.8.42.121 [122] => 194.8.42.122 [123] => 194.8.42.123 [124] => 194.8.42.124 [125] => 194.8.42.125 [126] => 194.8.42.126 [127] => 194.8.42.127 [128] => 194.8.42.128 [129] => 194.8.42.129 [130] => 194.8.42.130 [131] => 194.8.42.131 [132] => 194.8.42.132 [133] => 194.8.42.133 [134] => 194.8.42.134 [135] => 194.8.42.135 [136] => 194.8.42.136 [137] => 194.8.42.137 [138] => 194.8.42.138 [139] => 194.8.42.139 [140] => 194.8.42.140 [141] => 194.8.42.141 [142] => 194.8.42.142 [143] => 194.8.42.143 [144] => 194.8.42.144 [145] => 194.8.42.145 [146] => 194.8.42.146 [147] => 194.8.42.147 [148] => 194.8.42.148 [149] => 194.8.42.149 [150] => 194.8.42.150 [151] => 194.8.42.151 [152] => 194.8.42.152 [153] => 194.8.42.153 [154] => 194.8.42.154 [155] => 194.8.42.155 [156] => 194.8.42.156 [157] => 194.8.42.157 [158] => 194.8.42.158 [159] => 194.8.42.159 [160] => 194.8.42.160 [161] => 194.8.42.161 [162] => 194.8.42.162 [163] => 194.8.42.163 [164] => 194.8.42.164 [165] => 194.8.42.165 [166] => 194.8.42.166 [167] => 194.8.42.167 [168] => 194.8.42.168 [169] => 194.8.42.169 [170] => 194.8.42.170 [171] => 194.8.42.171 [172] => 194.8.42.172 [173] => 194.8.42.173 [174] => 194.8.42.174 [175] => 194.8.42.175 [176] => 194.8.42.176 [177] => 194.8.42.177 [178] => 194.8.42.178 [179] => 194.8.42.179 [180] => 194.8.42.180 [181] => 194.8.42.181 [182] => 194.8.42.182 [183] => 194.8.42.183 [184] => 194.8.42.184 [185] => 194.8.42.185 [186] => 194.8.42.186 [187] => 194.8.42.187 [188] => 194.8.42.188 [189] => 194.8.42.189 [190] => 194.8.42.190 [191] => 194.8.42.191 [192] => 194.8.42.192 [193] => 194.8.42.193 [194] => 194.8.42.194 [195] => 194.8.42.195 [196] => 194.8.42.196 [197] => 194.8.42.197 [198] => 194.8.42.198 [199] => 194.8.42.199 [200] => 194.8.42.200 [201] => 194.8.42.201 [202] => 194.8.42.202 [203] => 194.8.42.203 [204] => 194.8.42.204 [205] => 194.8.42.205 [206] => 194.8.42.206 [207] => 194.8.42.207 [208] => 194.8.42.208 [209] => 194.8.42.209 [210] => 194.8.42.210 [211] => 194.8.42.211 [212] => 194.8.42.212 [213] => 194.8.42.213 [214] => 194.8.42.214 [215] => 194.8.42.215 [216] => 194.8.42.216 [217] => 194.8.42.217 [218] => 194.8.42.218 [219] => 194.8.42.219 [220] => 194.8.42.220 [221] => 194.8.42.221 [222] => 194.8.42.222 [223] => 194.8.42.223 [224] => 194.8.42.224 [225] => 194.8.42.225 [226] => 194.8.42.226 [227] => 194.8.42.227 [228] => 194.8.42.228 [229] => 194.8.42.229 [230] => 194.8.42.230 [231] => 194.8.42.231 [232] => 194.8.42.232 [233] => 194.8.42.233 [234] => 194.8.42.234 [235] => 194.8.42.235 [236] => 194.8.42.236 [237] => 194.8.42.237 [238] => 194.8.42.238 [239] => 194.8.42.239 [240] => 194.8.42.240 [241] => 194.8.42.241 [242] => 194.8.42.242 [243] => 194.8.42.243 [244] => 194.8.42.244 [245] => 194.8.42.245 [246] => 194.8.42.246 [247] => 194.8.42.247 [248] => 194.8.42.248 [249] => 194.8.42.249 [250] => 194.8.42.250 [251] => 194.8.42.251 [252] => 194.8.42.252 [253] => 194.8.42.253 [254] => 194.8.42.254 [255] => 194.8.42.255 )
Output for hhvm-3.10.0 - 3.12.0
Array ( [0] => 194.8.42.0 )