3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $list_ar = array(); for($x = 0;$x < 500; $x++){ $val = generateRandomString(20); if(!in_array($val,$list_ar)){ echo "$x == NEW\n"; array_push($list_ar,$val); } else { echo "$x == IN ARRAY\n"; } } function generateRandomString($length){ $characterlist = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'; $characterlist_array = str_split($characterlist); $id = ''; for($a = 0;$a<$length;$a++){ shuffle($characterlist_array); $position = array_rand($characterlist_array, 1); $id .= $characterlist_array[$position]; } return $id; }
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
0 == NEW 1 == NEW 2 == NEW 3 == NEW 4 == NEW 5 == NEW 6 == NEW 7 == NEW 8 == NEW 9 == NEW 10 == NEW 11 == NEW 12 == NEW 13 == NEW 14 == NEW 15 == NEW 16 == NEW 17 == NEW 18 == NEW 19 == NEW 20 == NEW 21 == NEW 22 == NEW 23 == NEW 24 == NEW 25 == NEW 26 == NEW 27 == NEW 28 == NEW 29 == NEW 30 == NEW 31 == NEW 32 == NEW 33 == NEW 34 == NEW 35 == NEW 36 == NEW 37 == NEW 38 == NEW 39 == NEW 40 == NEW 41 == NEW 42 == NEW 43 == NEW 44 == NEW 45 == NEW 46 == NEW 47 == NEW 48 == NEW 49 == NEW 50 == NEW 51 == NEW 52 == NEW 53 == NEW 54 == NEW 55 == NEW 56 == NEW 57 == NEW 58 == NEW 59 == NEW 60 == NEW 61 == NEW 62 == NEW 63 == NEW 64 == NEW 65 == NEW 66 == NEW 67 == NEW 68 == NEW 69 == NEW 70 == NEW 71 == NEW 72 == NEW 73 == NEW 74 == NEW 75 == NEW 76 == NEW 77 == NEW 78 == NEW 79 == NEW 80 == NEW 81 == NEW 82 == NEW 83 == NEW 84 == NEW 85 == NEW 86 == NEW 87 == NEW 88 == NEW 89 == NEW 90 == NEW 91 == NEW 92 == NEW 93 == NEW 94 == NEW 95 == NEW 96 == NEW 97 == NEW 98 == NEW 99 == NEW 100 == NEW 101 == NEW 102 == NEW 103 == NEW 104 == NEW 105 == NEW 106 == NEW 107 == NEW 108 == NEW 109 == NEW 110 == NEW 111 == NEW 112 == NEW 113 == NEW 114 == NEW 115 == NEW 116 == NEW 117 == NEW 118 == NEW 119 == NEW 120 == NEW 121 == NEW 122 == NEW 123 == NEW 124 == NEW 125 == NEW 126 == NEW 127 == NEW 128 == NEW 129 == NEW 130 == NEW 131 == NEW 132 == NEW 133 == NEW 134 == NEW 135 == NEW 136 == NEW 137 == NEW 138 == NEW 139 == NEW 140 == NEW 141 == NEW 142 == NEW 143 == NEW 144 == NEW 145 == NEW 146 == NEW 147 == NEW 148 == NEW 149 == NEW 150 == NEW 151 == NEW 152 == NEW 153 == NEW 154 == NEW 155 == NEW 156 == NEW 157 == NEW 158 == NEW 159 == NEW 160 == NEW 161 == NEW 162 == NEW 163 == NEW 164 == NEW 165 == NEW 166 == NEW 167 == NEW 168 == NEW 169 == NEW 170 == NEW 171 == NEW 172 == NEW 173 == NEW 174 == NEW 175 == NEW 176 == NEW 177 == NEW 178 == NEW 179 == NEW 180 == NEW 181 == NEW 182 == NEW 183 == NEW 184 == NEW 185 == NEW 186 == NEW 187 == NEW 188 == NEW 189 == NEW 190 == NEW 191 == NEW 192 == NEW 193 == NEW 194 == NEW 195 == NEW 196 == NEW 197 == NEW 198 == NEW 199 == NEW 200 == NEW 201 == NEW 202 == NEW 203 == NEW 204 == NEW 205 == NEW 206 == NEW 207 == NEW 208 == NEW 209 == NEW 210 == NEW 211 == NEW 212 == NEW 213 == NEW 214 == NEW 215 == NEW 216 == NEW 217 == NEW 218 == NEW 219 == NEW 220 == NEW 221 == NEW 222 == NEW 223 == NEW 224 == NEW 225 == NEW 226 == NEW 227 == NEW 228 == NEW 229 == NEW 230 == NEW 231 == NEW 232 == NEW 233 == NEW 234 == NEW 235 == NEW 236 == NEW 237 == NEW 238 == NEW 239 == NEW 240 == NEW 241 == NEW 242 == NEW 243 == NEW 244 == NEW 245 == NEW 246 == NEW 247 == NEW 248 == NEW 249 == NEW 250 == NEW 251 == NEW 252 == NEW 253 == NEW 254 == NEW 255 == NEW 256 == NEW 257 == NEW 258 == NEW 259 == NEW 260 == NEW 261 == NEW 262 == NEW 263 == NEW 264 == NEW 265 == NEW 266 == NEW 267 == NEW 268 == NEW 269 == NEW 270 == NEW 271 == NEW 272 == NEW 273 == NEW 274 == NEW 275 == NEW 276 == NEW 277 == NEW 278 == NEW 279 == NEW 280 == NEW 281 == NEW 282 == NEW 283 == NEW 284 == NEW 285 == NEW 286 == NEW 287 == NEW 288 == NEW 289 == NEW 290 == NEW 291 == NEW 292 == NEW 293 == NEW 294 == NEW 295 == NEW 296 == NEW 297 == NEW 298 == NEW 299 == NEW 300 == NEW 301 == NEW 302 == NEW 303 == NEW 304 == NEW 305 == NEW 306 == NEW 307 == NEW 308 == NEW 309 == NEW 310 == NEW 311 == NEW 312 == NEW 313 == NEW 314 == NEW 315 == NEW 316 == NEW 317 == NEW 318 == NEW 319 == NEW 320 == NEW 321 == NEW 322 == NEW 323 == NEW 324 == NEW 325 == NEW 326 == NEW 327 == NEW 328 == NEW 329 == NEW 330 == NEW 331 == NEW 332 == NEW 333 == NEW 334 == NEW 335 == NEW 336 == NEW 337 == NEW 338 == NEW 339 == NEW 340 == NEW 341 == NEW 342 == NEW 343 == NEW 344 == NEW 345 == NEW 346 == NEW 347 == NEW 348 == NEW 349 == NEW 350 == NEW 351 == NEW 352 == NEW 353 == NEW 354 == NEW 355 == NEW 356 == NEW 357 == NEW 358 == NEW 359 == NEW 360 == NEW 361 == NEW 362 == NEW 363 == NEW 364 == NEW 365 == NEW 366 == NEW 367 == NEW 368 == NEW 369 == NEW 370 == NEW 371 == NEW 372 == NEW 373 == NEW 374 == NEW 375 == NEW 376 == NEW 377 == NEW 378 == NEW 379 == NEW 380 == NEW 381 == NEW 382 == NEW 383 == NEW 384 == NEW 385 == NEW 386 == NEW 387 == NEW 388 == NEW 389 == NEW 390 == NEW 391 == NEW 392 == NEW 393 == NEW 394 == NEW 395 == NEW 396 == NEW 397 == NEW 398 == NEW 399 == NEW 400 == NEW 401 == NEW 402 == NEW 403 == NEW 404 == NEW 405 == NEW 406 == NEW 407 == NEW 408 == NEW 409 == NEW 410 == NEW 411 == NEW 412 == NEW 413 == NEW 414 == NEW 415 == NEW 416 == NEW 417 == NEW 418 == NEW 419 == NEW 420 == NEW 421 == NEW 422 == NEW 423 == NEW 424 == NEW 425 == NEW 426 == NEW 427 == NEW 428 == NEW 429 == NEW 430 == NEW 431 == NEW 432 == NEW 433 == NEW 434 == NEW 435 == NEW 436 == NEW 437 == NEW 438 == NEW 439 == NEW 440 == NEW 441 == NEW 442 == NEW 443 == NEW 444 == NEW 445 == NEW 446 == NEW 447 == NEW 448 == NEW 449 == NEW 450 == NEW 451 == NEW 452 == NEW 453 == NEW 454 == NEW 455 == NEW 456 == NEW 457 == NEW 458 == NEW 459 == NEW 460 == NEW 461 == NEW 462 == NEW 463 == NEW 464 == NEW 465 == NEW 466 == NEW 467 == NEW 468 == NEW 469 == NEW 470 == NEW 471 == NEW 472 == NEW 473 == NEW 474 == NEW 475 == NEW 476 == NEW 477 == NEW 478 == NEW 479 == NEW 480 == NEW 481 == NEW 482 == NEW 483 == NEW 484 == NEW 485 == NEW 486 == NEW 487 == NEW 488 == NEW 489 == NEW 490 == NEW 491 == NEW 492 == NEW 493 == NEW 494 == NEW 495 == NEW 496 == NEW 497 == NEW 498 == NEW 499 == NEW
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: str_split() in /in/L85sf on line 15
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: str_split() in /in/L85sf on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: str_split() in /in/L85sf on line 15