3v4l.org

run code in 300+ PHP versions simultaneously
<?php $range = "INSERT MAX BET NUMBER"; //----------------Insert between the quotes the number of latest bet made within block 499,999 $blockhash = "INSERT HASH OF BLOCK #500.000"; //-----Insert between the quotes the hash of block number 500.000 $hash = hash('sha256', $blockhash); //--------------Create sha256 hash from block hash $hex = substr($hash, 0, 8); //----------------------Take first 8 characters $dec = hexdec($hex); //-----------------------------From hexadecimal to decimal number (max possible number: 4294967295) $random = ($dec * ($range - 1)) / 4294967295; //----Reduce max possible number to $range number $winner = round($random) + 1; //--------------------Transform number to INT and avoid number 0 echo "The winner of 0.01 BTC is the bet number: " . $winner; ?>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0090.00918.39
8.3.50.0090.00619.75
8.3.40.0070.01118.76
8.3.30.0090.00618.84
8.3.20.0040.00420.04
8.3.10.0030.00518.94
8.3.00.0000.00721.91
8.2.180.0070.01418.29
8.2.170.0090.00622.96
8.2.160.0110.00322.96
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0050.00219.69
8.2.110.0100.00020.82
8.2.100.0000.01217.91
8.2.90.0040.00420.59
8.2.80.0030.00620.57
8.2.70.0030.00517.38
8.2.60.0000.00717.50
8.2.50.0040.00417.63
8.2.40.0030.00519.35
8.2.30.0040.00419.06
8.2.20.0040.00417.90
8.2.10.0000.00818.16
8.2.00.0040.00418.11
8.1.280.0030.01625.92
8.1.270.0000.00722.14
8.1.260.0030.00526.35
8.1.250.0050.00328.09
8.1.240.0170.00022.14
8.1.230.0090.00320.91
8.1.220.0070.00017.76
8.1.210.0000.00818.91
8.1.200.0030.00517.23
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0030.00517.62
8.1.160.0070.00018.83
8.1.150.0080.00018.80
8.1.140.0070.00019.07
8.1.130.0000.00718.73
8.1.120.0040.00817.38
8.1.110.0000.00717.37
8.1.100.0000.00817.34
8.1.90.0070.00017.39
8.1.80.0050.00217.28
8.1.70.0050.00217.32
8.1.60.0000.00817.48
8.1.50.0050.00817.41
8.1.40.0050.00217.50
8.1.30.0040.00417.72
8.1.20.0040.00417.63
8.1.10.0060.00317.47
8.1.00.0000.00817.50
8.0.300.0000.00820.09
8.0.290.0000.00816.63
8.0.280.0040.00418.43
8.0.270.0000.00817.25
8.0.260.0040.00418.30
8.0.250.0030.00316.98
8.0.240.0080.00016.92
8.0.230.0030.00316.95
8.0.220.0060.00316.89
8.0.210.0050.00216.80
8.0.200.0030.00316.96
8.0.190.0060.00316.95
8.0.180.0040.00416.95
8.0.170.0000.00716.94
8.0.160.0060.00317.00
8.0.150.0040.00416.79
8.0.140.0080.00016.86
8.0.130.0000.00613.33
8.0.120.0070.00016.86
8.0.110.0000.00716.73
8.0.100.0040.00416.84
8.0.90.0000.00716.88
8.0.80.0070.00716.78
8.0.70.0040.00416.78
8.0.60.0000.00716.77
8.0.50.0000.00716.76
8.0.30.0120.00416.74
8.0.20.0080.01217.40
8.0.10.0030.00516.90
8.0.00.0090.00916.80
7.4.330.0060.00015.55
7.4.320.0060.00016.59
7.4.300.0000.00716.45
7.4.290.0080.00016.49
7.4.280.0030.00616.51
7.4.270.0000.00716.59
7.4.260.0030.00316.41
7.4.250.0000.00716.55
7.4.240.0050.00216.56
7.4.230.0040.00416.38
7.4.220.0120.00616.66
7.4.210.0110.00616.54
7.4.200.0050.00316.39
7.4.160.0120.00716.66
7.4.150.0030.01417.40
7.4.140.0090.00917.86
7.4.130.0000.01616.52
7.4.120.0140.00616.53
7.4.110.0130.01016.52
7.4.100.0050.01116.65
7.4.90.0060.01216.41
7.4.80.0140.00319.39
7.4.70.0130.00616.66
7.4.60.0130.00316.49
7.4.50.0060.01116.24
7.4.40.0120.00916.43
7.4.30.0060.00916.41
7.4.10.0060.00814.83
7.4.00.0080.00814.92
7.3.330.0020.00213.21
7.3.320.0030.00313.14
7.3.310.0000.00716.23
7.3.300.0070.00016.28
7.3.290.0000.00716.41
7.3.280.0080.00916.43
7.3.270.0140.00517.40
7.3.260.0050.01416.54
7.3.250.0110.00716.41
7.3.240.0130.00916.46
7.3.230.0040.01416.48
7.3.210.0030.01316.67
7.3.200.0090.00616.33
7.3.190.0050.01116.39
7.3.180.0060.01016.50
7.3.170.0120.00316.32
7.3.160.0000.01716.53
7.3.130.0070.01014.67
7.3.120.0090.00614.75
7.3.110.0090.00914.86
7.3.100.0060.00814.73
7.3.90.0090.00514.60
7.3.80.0080.00314.83
7.3.70.0080.00614.96
7.3.60.0080.00914.71
7.3.50.0020.01214.65
7.3.40.0070.00514.78
7.3.30.0070.00514.74
7.3.20.0050.00916.59
7.3.10.0050.00916.55
7.3.00.0060.00916.45
7.2.330.0080.00916.47
7.2.320.0090.01116.55
7.2.310.0110.00716.71
7.2.300.0120.00916.78
7.2.290.0070.01316.80
7.2.260.0100.01015.25
7.2.250.0080.01015.10
7.2.240.0020.01315.04
7.2.230.0090.00814.99
7.2.220.0050.00914.97
7.2.210.0060.00914.84
7.2.200.0020.01115.04
7.2.190.0120.00414.90
7.2.180.0060.00515.08
7.2.170.0030.00814.86
7.2.160.0070.01015.00
7.2.150.0080.00617.02
7.2.140.0000.01116.91
7.2.130.0090.00716.79
7.2.120.0080.00616.78
7.2.110.0040.00816.94
7.2.100.0090.00416.96
7.2.90.0050.01117.00
7.2.80.0100.00317.01
7.2.70.0040.00817.06
7.2.60.0050.00716.83
7.2.50.0060.00817.01
7.2.40.0030.00716.89
7.2.30.0100.00416.76
7.2.20.0040.00817.02
7.2.10.0050.00716.75
7.2.00.0060.00817.91
7.1.330.0080.00515.46
7.1.320.0040.00915.76
7.1.310.0040.00815.70
7.1.300.0060.01015.77
7.1.290.0060.00715.60
7.1.280.0080.00515.72
7.1.270.0090.00415.55
7.1.260.0060.00515.67
7.1.250.0010.01015.65
7.1.240.0070.00715.56
7.1.230.0030.01115.76
7.1.220.0040.00415.82
7.1.210.0060.00315.85
7.1.200.0020.00815.63
7.1.190.0030.01015.83
7.1.180.0050.00515.57
7.1.170.0110.00315.66
7.1.160.0090.00015.94
7.1.150.0070.00715.50
7.1.140.0000.00915.77
7.1.130.0060.00915.85
7.1.120.0060.00717.15
7.1.110.0020.01116.90
7.1.100.0040.00616.97
7.1.90.0080.00817.00
7.1.80.0060.00916.85
7.1.70.0100.00516.44
7.1.60.0070.00925.50
7.1.50.0070.01125.42
7.1.40.0070.00824.94
7.1.30.0110.00525.14
7.1.20.0080.01125.13
7.1.10.0090.00316.11
7.1.00.0020.01016.20
7.0.330.0030.01215.53
7.0.320.0100.00315.44
7.0.310.0030.01015.05
7.0.300.0080.00415.60
7.0.290.0000.00915.36
7.0.280.0030.01015.57
7.0.270.0030.01015.50
7.0.260.0060.01015.41
7.0.250.0120.00015.34
7.0.240.0070.00715.49
7.0.230.0030.00615.33
7.0.220.0000.01715.52
7.0.210.0000.01315.16
7.0.200.0030.01315.41
7.0.190.0110.00415.45
7.0.180.0030.00715.42
7.0.170.0030.01015.46
7.0.160.0090.00315.14
7.0.150.0030.00515.32
7.0.140.0100.00315.46
7.0.130.0030.01315.43
7.0.120.0080.00815.59
7.0.110.0050.00515.41
7.0.100.0000.01315.35
7.0.90.0090.00315.58
7.0.80.0000.01115.33
7.0.70.0090.00615.42
7.0.60.0080.00415.32
7.0.50.0000.01115.61
7.0.40.0060.01013.45
7.0.30.0030.00513.46
7.0.20.0090.00313.50
7.0.10.0000.00813.54
7.0.00.0070.00713.66
5.6.400.0030.01014.39
5.6.390.0030.01014.50
5.6.380.0070.00714.14
5.6.370.0000.01114.36
5.6.360.0030.01014.26
5.6.350.0100.00313.89
5.6.340.0000.00914.37
5.6.330.0120.00314.30
5.6.320.0110.00414.23
5.6.310.0070.01114.30
5.6.300.0080.00414.43
5.6.290.0040.00714.25
5.6.280.0070.01114.41
5.6.270.0090.00614.42
5.6.260.0060.00614.36
5.6.250.0090.00614.60
5.6.240.0120.00314.50
5.6.230.0070.00713.98
5.6.220.0060.00914.53
5.6.210.0070.01014.00
5.6.200.0030.01014.26
5.6.190.0080.00314.13
5.6.180.0090.00314.19
5.6.170.0030.01013.88
5.6.160.0000.01314.10
5.6.150.0000.01414.25
5.6.140.0030.01014.48
5.6.130.0030.01014.21
5.6.120.0040.01214.29
5.6.110.0090.00914.05
5.6.100.0000.01114.42
5.6.90.0070.00314.64
5.6.80.0030.01214.04
5.6.70.0080.00814.27
5.6.60.0050.00514.05
5.6.50.0100.00314.34
5.6.40.0120.00014.26
5.6.30.0000.01414.16
5.6.20.0070.00414.12
5.6.10.0040.01114.11
5.6.00.0040.00814.38

preferences:
57.18 ms | 401 KiB | 5 Q