3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 0xfffffffffffffbff; echo rand(0, $a)."\n"; echo rand(0, $a - 1)."\n"; echo rand(0, $a - 3)."\n";
Output for 7.0.0 - 7.1.0
Warning: rand() expects parameter 2 to be integer, float given in /in/iO24G on line 6 Warning: rand() expects parameter 2 to be integer, float given in /in/iO24G on line 7 Warning: rand() expects parameter 2 to be integer, float given in /in/iO24G on line 8
Output for hhvm-3.12.0
Warning: rand() expects parameter 2 to be integer, double given in /in/iO24G on line 6 Warning: rand() expects parameter 2 to be integer, double given in /in/iO24G on line 7 Warning: rand() expects parameter 2 to be integer, double given in /in/iO24G on line 8
Output for hhvm-3.10.0
-1176 -907 -1316
Output for 5.6.28
-1316 -769 -1244
Output for 5.6.25
-752 -1068 -1988
Output for 5.6.24
-1515 -1215 -1468
Output for 5.6.23
-1654 -1326 -404
Output for 5.6.22
-1994 -870 -415
Output for 5.6.21
-623 -319 -1451
Output for 5.6.20
-162 -179 -532
Output for 5.6.19
-1377 -979 -499
Output for 5.6.18
-181 -716 -1951
Output for 5.6.17
-89 -885 -1247
Output for 5.6.16
-52 -1571 -1768
Output for 5.6.15
-736 -62 -347
Output for 5.6.14
-1344 -111 -628
Output for 5.6.13
-440 -833 -671
Output for 5.6.12
-334 -252 -1695
Output for 5.6.11
-1667 -1302 -1047
Output for 5.6.10
-789 -1634 -414
Output for 5.6.9
-1215 -1734 -378
Output for 5.6.8
-629 -958 -505
Output for 5.6.7
-1875 -981 -644
Output for 5.6.6
-404 -712 -985
Output for 5.6.5
-1647 -1312 -641
Output for 5.6.4
-366 -1557 -570
Output for 5.6.3
-244 -1018 -1536
Output for 5.6.2
-1653 -1 -17
Output for 5.6.1
-384 -1198 -1291
Output for 5.6.0
-1308 -842 -1806
Output for 5.5.38
-1012 -1050 -31
Output for 5.5.37
-1400 -862 -1717
Output for 5.5.36
-1708 -795 -420
Output for 5.5.35
-1765 -158 -2034
Output for 5.5.34
-364 -827 -355
Output for 5.5.33
-1650 -774 -1784
Output for 5.5.32
-863 -920 -1528
Output for 5.5.31
-1624 -1108 -1796
Output for 5.5.30
-1670 -1787 -324
Output for 5.5.29
-1037 -791 -542
Output for 5.5.28
-351 -920 -1793
Output for 5.5.27
-1090 -1089 -1881
Output for 5.5.26
-488 -2036 -1991
Output for 5.5.25
-971 -528 -941
Output for 5.5.24
-1553 -47 -230
Output for 5.5.23
-1687 -227 -1092
Output for 5.5.22
-1825 -1596 -994
Output for 5.5.21
-1223 -1496 -808
Output for 5.5.20
-121 -1524 -880
Output for 5.5.19
-514 -1010 -991
Output for 5.5.18
-197 -1820 -1045
Output for 5.5.16
-1449 -1710 -45
Output for 5.5.15
-23 -514 -1503
Output for 5.5.14
-165 -453 -945
Output for 5.5.13
-514 -1967 -781
Output for 5.5.12
-1766 -1388 -1444
Output for 5.5.11
-380 -1340 -1836
Output for 5.5.10
-1770 -310 -288
Output for 5.5.9
-662 -1059 -220
Output for 5.5.8
-1915 -386 -394
Output for 5.5.7
-787 -1351 -1333
Output for 5.5.6
-97 -121 -1211
Output for 5.5.5
-353 -913 -374
Output for 5.5.4
-1687 -2018 -1377
Output for 5.5.3
-1648 -1471 -651
Output for 5.5.2
-1692 -931 -872
Output for 5.5.1
-1950 -381 -864
Output for 5.5.0
-975 -985 -1236
Output for 5.4.45
-219 -1200 -1287
Output for 5.4.44
-2035 -1943 -688
Output for 5.4.43
-765 -1259 -598
Output for 5.4.42
-1453 -157 -1630
Output for 5.4.41
-904 -472 -1735
Output for 5.4.40
-952 -42 -272
Output for 5.4.39
-1780 -1327 -1616
Output for 5.4.38
-1963 -603 -784
Output for 5.4.37
-628 -1180 -888
Output for 5.4.36
-1732 -956 -390
Output for 5.4.35
-423 -179 -1785
Output for 5.4.34
-1902 -1588 -1330
Output for 5.4.32
-43 -1642 -914
Output for 5.4.31
-127 -1959 -1846
Output for 5.4.30
-1640 -1403 -130
Output for 5.4.29
-1976 -586 -103
Output for 5.4.28
-1121 -504 -880
Output for 5.4.27
-1525 -1040 -122
Output for 5.4.26
-931 -1273 -413
Output for 5.4.25
-792 -493 -54
Output for 5.4.24
-1671 -27 -833
Output for 5.4.23
-1428 -1521 -1006
Output for 5.4.22
-974 -684 -150
Output for 5.4.21
-916 -1033 -295
Output for 5.4.20
-188 -1151 -546
Output for 5.4.19
-1420 -1500 -882
Output for 5.4.18
-37 -794 -1548
Output for 5.4.17
-388 -659 -879
Output for 5.4.16
-618 -1113 -489
Output for 5.4.15
-1395 -1450 -825
Output for 5.4.14
-9 -1069 -1170
Output for 5.4.13
-1958 -1046 -720
Output for 5.4.12
-1221 -1248 -527
Output for 5.4.11
-852 -462 -1432
Output for 5.4.10
-906 -1725 -23
Output for 5.4.9
-1022 -1038 -1991
Output for 5.4.8
-1581 -119 -1330
Output for 5.4.7
-942 -904 -52
Output for 5.4.6
-1288 -1240 -1626
Output for 5.4.5
-949 -1334 -1150
Output for 5.4.4
-1618 -559 -306
Output for 5.4.3
-1528 -1113 -1794
Output for 5.4.2
-1029 -10 -147
Output for 5.4.1
-1826 -2 -2040
Output for 5.4.0
-896 -230 -1923
Output for 5.3.29
-127 -297 -641
Output for 5.3.28
-1270 -1640 -1344
Output for 5.3.27
-316 -1886 -262
Output for 5.3.26
-1474 -1700 -1041
Output for 5.3.25
-425 -821 -821
Output for 5.3.24
-1825 -1775 -1634
Output for 5.3.23
-438 -1748 -1774
Output for 5.3.22
-1704 -877 -1601
Output for 5.3.21
-283 -2029 -944
Output for 5.3.20
-1690 -412 -186
Output for 5.3.19
-985 -2037 -13
Output for 5.3.18
-114 -1598 -1894
Output for 5.3.17
-213 -1726 -1803
Output for 5.3.16
-995 -1957 -774
Output for 5.3.15
-766 -796 -640
Output for 5.3.14
-809 -1356 -1282
Output for 5.3.13
-709 -447 -1454
Output for 5.3.12
-1128 -58 -1600
Output for 5.3.11
-1652 -1437 -368
Output for 5.3.10
-1958 -1229 -1086
Output for 5.3.9
-129 -819 -1983
Output for 5.3.8
-2022 -1098 -352
Output for 5.3.7
-1168 -1285 -1511
Output for 5.3.6
-1726 -577 -522
Output for 5.3.5
-482 -1796 -365
Output for 5.3.4
-246 -1339 -1178
Output for 5.3.3
-992 -1804 -890
Output for 5.3.2
-347 -678 -1680
Output for 5.3.1
-529 -1615 -1022
Output for 5.3.0
-781 -913 -1326
Output for 5.2.17
-1188 -759 -1438
Output for 5.2.16
-1602 -1616 -679
Output for 5.2.15
-1666 -1592 -344
Output for 5.2.14
-1843 -244 -861
Output for 5.2.13
-2043 -178 -325
Output for 5.2.12
-604 -1300 -191
Output for 5.2.11
-803 -248 -568
Output for 5.2.10
-39 -1775 -375
Output for 5.2.9
-482 -2034 -300
Output for 5.2.8
-1908 -1146 -1589
Output for 5.2.7
-1561 -1130 -235
Output for 5.2.6
-770 -991 -787
Output for 5.2.5
-922 -1096 -20
Output for 5.2.4
-2001 -1394 -154
Output for 5.2.3
-1977 -754 -1910
Output for 5.2.2
-875 -741 -1189
Output for 5.2.1
-1157 -957 -447
Output for 5.2.0
-1469 -2026 -71
Output for 5.1.6
-655 -952 -210
Output for 5.1.5
-1799 -1883 -1946
Output for 5.1.4
-201 -876 -1130
Output for 5.1.3
-951 -2024 -747
Output for 5.1.2
-692 -1737 -1870
Output for 5.1.1
-1200 -1203 -177
Output for 5.1.0
-1200 -1024 -1606
Output for 5.0.5
-1536 -1140 -1585
Output for 5.0.4
-884 -1564 -1040
Output for 5.0.3
-189 -1704 -1301
Output for 5.0.2
1398197569233879040 3924326869784068096 6958332956414836736
Output for 5.0.1
-1965 -1735 -1347
Output for 5.0.0
-151 -1485 -1199
Output for 4.4.9
-219 -405 -1832
Output for 4.4.8
-116 -70 -1434
Output for 4.4.7
-1792 -340 -619
Output for 4.4.6
-1605 -466 -1812
Output for 4.4.5
-259 -513 -1681
Output for 4.4.4
-787 -1430 -1580
Output for 4.4.3
-99 -93 -534
Output for 4.4.2
-9 -872 -928
Output for 4.4.1
-276 -1327 -1963
Output for 4.4.0
-162 -1531 -794
Output for 4.3.11
-770 -420 -231
Output for 4.3.10
-294 -1146 -1277
Output for 4.3.9
-1798 -1216 -1475
Output for 4.3.8
-1372 -166 -1306
Output for 4.3.7
-2034 -722 -1012
Output for 4.3.6
-1942 -589 -537
Output for 4.3.5
-569 -1999 -731
Output for 4.3.4
-793 -665 -673
Output for 4.3.3
-146 -458 -1342
Output for 4.3.2
-759 -1017 -1761
Output for 4.3.1
-533 -573 -1825
Output for 4.3.0
-1905 -790 -383