3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo roll_dice(); function roll_dice() { mt_srand(make_seed()); return clamp(mt_rand(0,7),1,6); } function make_seed() { list($usec,$sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 65536); //100000 } function clamp($in, $min, $max) { return (int)(($in < $min) ? $min : ($in > $max) ? $max : $in); } ?>

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)
7.4.10.0030.01714.75
7.4.00.0150.00314.75
7.3.130.0100.01014.47
7.3.120.0040.01114.64
7.3.110.0060.01014.78
7.3.100.0100.01014.89
7.3.90.0070.01014.79
7.3.80.0060.01014.51
7.3.70.0120.00614.67
7.3.60.0100.00714.70
7.3.50.0080.00414.93
7.3.40.0030.01014.45
7.3.30.0000.00914.87
7.3.20.0060.01016.64
7.3.10.0030.00716.43
7.3.00.0030.01016.37
7.2.260.0100.01014.91
7.2.250.0060.01214.48
7.2.240.0070.01014.93
7.2.230.0030.01315.05
7.2.220.0000.01514.52
7.2.210.0090.00314.72
7.2.200.0070.01014.87
7.2.190.0080.00814.83
7.2.180.0090.00414.92
7.2.170.0040.01114.85
7.2.160.0060.00615.00
7.2.150.0040.00716.38
7.2.140.0040.00816.61
7.2.130.0030.01016.86
7.2.120.0090.00016.71
7.2.110.0080.00416.67
7.2.100.0040.01116.79
7.2.90.0030.01016.63
7.2.80.0030.01116.94
7.2.70.0070.00716.42
7.2.60.0110.00416.42
7.2.50.0030.01716.73
7.2.40.0060.00916.80
7.2.30.0060.01316.82
7.2.20.0040.01216.84
7.2.10.0060.00916.62
7.2.00.0030.01218.03
7.1.330.0060.00915.69
7.1.320.0060.00615.65
7.1.310.0080.00815.59
7.1.300.0000.00815.80
7.1.290.0140.00015.58
7.1.280.0000.01315.27
7.1.270.0000.01515.93
7.1.260.0040.00815.96
7.1.250.0120.00315.84
7.1.240.0020.01115.63
7.1.230.0030.00715.73
7.1.220.0000.01215.41
7.1.210.0090.00315.61
7.1.200.0030.01015.79
7.1.190.0070.00415.60
7.1.180.0060.00915.60
7.1.170.0070.01115.60
7.1.160.0000.01015.72
7.1.150.0030.01115.63
7.1.140.0100.00315.70
7.1.130.0030.00915.62
7.1.120.0000.01215.42
7.1.110.0000.01215.77
7.1.100.0100.00315.37
7.1.90.0000.01415.47
7.1.80.0070.00715.61
7.1.70.0110.00016.33
7.1.60.0080.01117.51
7.1.50.0070.01016.41
7.1.40.0030.01115.35
7.1.30.0030.01015.82
7.1.20.0030.00515.39
7.1.10.0070.00315.55
7.1.00.0010.04618.94
7.0.330.0030.00715.03
7.0.320.0030.00915.48
7.0.310.0090.00315.35
7.0.300.0040.00815.19
7.0.290.0040.00415.36
7.0.280.0000.01415.14
7.0.270.0080.00615.22
7.0.260.0060.00615.15
7.0.250.0100.00315.18
7.0.240.0030.00715.25
7.0.230.0000.01315.19
7.0.220.0060.00614.98
7.0.210.0030.01215.06
7.0.200.0040.00615.82
7.0.190.0060.00915.09
7.0.180.0000.01715.27
7.0.170.0040.00415.18
7.0.160.0030.00615.04
7.0.150.0090.00415.37
7.0.140.0030.04218.61
7.0.130.0070.00715.31
7.0.120.0000.00815.33
7.0.110.0070.00315.32
7.0.100.0050.00515.14
7.0.90.0030.00815.13
7.0.80.0110.00415.35
7.0.70.0060.00615.29
7.0.60.0040.02217.51
7.0.50.0070.02716.43
7.0.40.0100.04716.68
7.0.30.0130.04516.74
7.0.20.0180.02616.78
7.0.10.0150.04316.77
7.0.00.0080.02716.90
5.6.400.0070.00714.36
5.6.390.0050.00514.05
5.6.380.0070.00713.96
5.6.370.0060.00614.27
5.6.360.0040.01214.30
5.6.350.0040.00814.49
5.6.340.0070.00714.36
5.6.330.0060.00914.29
5.6.320.0050.00514.34
5.6.310.0040.00413.94
5.6.300.0030.01014.48
5.6.290.0030.00914.41
5.6.280.0050.04117.63
5.6.270.0060.00914.34
5.6.260.0060.00614.29
5.6.250.0100.00314.18
5.6.240.0050.00514.03
5.6.230.0060.00314.09
5.6.220.0090.00414.19
5.6.210.0090.03917.48
5.6.200.0020.02816.39
5.6.190.0130.04017.39
5.6.180.1750.02517.41
5.6.170.0130.04917.67
5.6.160.0040.04917.40
5.6.150.0050.04516.26
5.6.140.0050.04816.18
5.6.130.0080.03016.30
5.6.120.0090.04217.60
5.6.110.0070.04117.75
5.6.100.0030.04517.59
5.6.90.0080.04617.63
5.6.80.0070.03317.17
5.6.70.0070.02017.44
5.6.60.0110.00414.23
5.6.50.0060.00314.14
5.6.40.0070.00713.97
5.6.30.0110.00414.04
5.6.20.0070.01014.42
5.6.10.0090.00314.10
5.6.00.0030.01014.06
5.5.380.0100.00714.34
5.5.370.0030.00614.38
5.5.360.0070.00713.78
5.5.350.0130.03017.23
5.5.340.0040.02416.02
5.5.330.0060.03617.50
5.5.320.0050.04917.48
5.5.310.0160.03917.15
5.5.300.0040.02416.02
5.5.290.0010.02615.95
5.5.280.0100.03317.77
5.5.270.0090.02217.39
5.5.260.0080.04317.58
5.5.250.0070.04717.33
5.5.240.0050.02217.34
5.5.230.0040.00714.21
5.5.220.0070.00314.20
5.5.210.0030.00614.06
5.5.200.0040.00814.20
5.5.190.0000.01114.40
5.5.180.0070.00714.21
5.5.170.0000.01314.16
5.5.160.0030.01113.99
5.5.150.0070.00314.01
5.5.140.0040.01314.36
5.5.130.0160.00314.07
5.5.120.0090.00314.20
5.5.110.0080.00614.10
5.5.100.0040.01414.14
5.5.90.0040.01314.30
5.5.80.0050.01014.27
5.5.70.0030.01313.72
5.5.60.0060.00914.41
5.5.50.0070.01314.32
5.5.40.0040.01314.06
5.5.30.0110.00314.33
5.5.20.0090.00314.16
5.5.10.0100.00614.12
5.5.00.0000.01413.79
5.4.450.0070.03315.21
5.4.440.0280.03315.07
5.4.430.0370.03315.34
5.4.420.0360.00315.29
5.4.410.0150.02615.09
5.4.400.0170.02714.82
5.4.390.0200.03914.82
5.4.380.0130.03014.88
5.4.370.0020.03814.98
5.4.360.0030.02714.94
5.4.350.0040.02111.46
5.4.340.0070.01811.50
5.4.330.0000.00910.82
5.4.320.0060.03211.68
5.4.310.0040.02411.61
5.4.300.0110.02011.66
5.4.290.0130.03711.80
5.4.280.0060.03111.84
5.4.270.0070.04811.77
5.4.260.0090.03211.80
5.4.250.0090.02511.75
5.4.240.0080.03011.68
5.4.230.0090.03311.71
5.4.220.0070.04511.44
5.4.210.0120.03911.54
5.4.200.0120.03511.75
5.4.190.0160.04911.81
5.4.180.0110.02411.86
5.4.170.0100.03311.73
5.4.160.0060.02211.73
5.4.150.0130.04411.77
5.4.140.0080.04211.61
5.4.130.0090.03511.49
5.4.120.0060.03411.66
5.4.110.0120.03611.60
5.4.100.0090.02911.47
5.4.90.0070.03311.55
5.4.80.0080.04211.55
5.4.70.0100.04011.54
5.4.60.0170.05711.44
5.4.50.0080.02711.54
5.4.40.0090.05411.51
5.4.30.0110.06711.62
5.4.20.0060.03911.45
5.4.10.0070.04111.34
5.4.00.0070.02411.32
5.3.290.0050.02611.75
5.3.280.0090.02511.63
5.3.270.0070.03111.64
5.3.260.0130.06111.65
5.3.250.0060.04211.68
5.3.240.0040.03011.49
5.3.230.0100.05111.65
5.3.220.0150.04611.53
5.3.210.0070.03211.61
5.3.200.0110.03711.59
5.3.190.0050.03011.64
5.3.180.0100.04011.55
5.3.170.0090.04011.73
5.3.160.0070.03511.60
5.3.150.0140.07811.56
5.3.140.0070.07411.58
5.3.130.0110.07411.58
5.3.120.0100.03011.62
5.3.110.0060.02811.60
5.3.100.0110.03811.32
5.3.90.0100.03811.38
5.3.80.0060.04911.19
5.3.70.0060.02811.27
5.3.60.0050.02711.32
5.3.50.0090.03511.23
5.3.40.0060.03111.23
5.3.30.0070.02911.29
5.3.20.0050.02711.06
5.3.10.0070.02810.95
5.3.00.0090.04110.97
5.2.170.0220.0939.23
5.2.160.0080.0689.23
5.2.150.0060.0699.23
5.2.140.0070.0569.23
5.2.130.0150.0709.18
5.2.120.0170.0659.19
5.2.110.0120.0429.19
5.2.100.0110.0469.18
5.2.90.0080.0689.18
5.2.80.0140.0539.18
5.2.70.0150.0709.18
5.2.60.0140.0849.14
5.2.50.0150.0659.11
5.2.40.0100.0439.09
5.2.30.0100.0619.06
5.2.20.0100.0429.04
5.2.10.0090.0818.95
5.2.00.0100.0728.81
5.1.60.0100.0388.10
5.1.50.0070.0458.10
5.1.40.0080.0388.07
5.1.30.0100.0388.43
5.1.20.0120.0668.44
5.1.10.0080.0378.18
5.1.00.0080.0288.17
5.0.50.0030.0296.64
5.0.40.0050.0346.51
5.0.30.0120.0646.32
5.0.20.0160.0446.32
5.0.10.0110.0596.30
5.0.00.0070.0436.29
4.4.90.0040.0454.77
4.4.80.0040.0204.75
4.4.70.0110.0364.75
4.4.60.0040.0504.76
4.4.50.0100.0284.77
4.4.40.0050.0324.71
4.4.30.0020.0244.76
4.4.20.0030.0244.84
4.4.10.0060.0214.85
4.4.00.0120.0694.76
4.3.110.0120.0334.67
4.3.100.0090.0274.67
4.3.90.0030.0234.63
4.3.80.0070.0314.59
4.3.70.0050.0344.63
4.3.60.0070.0354.63
4.3.50.0050.0254.63
4.3.40.0070.0294.54
4.3.30.0050.0203.35
4.3.20.0030.0263.32
4.3.10.0030.0243.29
4.3.00.0130.0206.66

preferences:
36.25 ms | 400 KiB | 5 Q