3v4l.org

run code in 300+ PHP versions simultaneously
<?php function array_average ($t) { return array_sum($t)/sizeof ($t); } function note ($t) { return array_average ($t) - stats_standard_deviation ($t); } if (!function_exists('stats_standard_deviation')) { function stats_standard_deviation(array $a, $sample = false) { $n = count($a); if ($n === 0) {trigger_error("The array has zero elements", E_USER_WARNING); return false; } if ($sample && $n === 1) { trigger_error("The array has 1 element", E_USER_WARNING);return false;} $mean = array_sum($a) / $n; $carry = 0.0; foreach ($a as $val) { $d = ((double) $val) - $mean; $carry += $d * $d; }; if ($sample) {--$n;} return sqrt($carry / $n); } } $tableau1 = [6,6,6,0,0]; $tableau2 = [3,3,3,4,4]; echo "En prenant en compte la moyenne\n"; echo "tableau1 = ".array_average ($tableau1)."\n"; echo "tableau2 = ".array_average ($tableau2)."\n"; if (array_average ($tableau1)>array_average ($tableau2)) echo "tableau 1 a une meilleure moyenne."; else echo "tableau 2 a une meilleure moyenne."; echo "\n";echo "\n"; echo "En prenant en compte la moyenne - écart_type\n"; echo "tableau1 = ".note ($tableau1)."\n"; echo "tableau2 = ".note ($tableau2)."\n"; if (note ($tableau1)>note ($tableau2)) echo "tableau 1 a une meilleure note (moyenne-écart_type)."; else echo "tableau 2 a une meilleure note (moyenne - écart_type)."; echo "\n"; ?>

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.4.120.0030.00620.56
8.4.110.0110.00818.70
8.4.100.0130.00717.71
8.4.90.0140.00717.77
8.4.80.0030.00717.84
8.4.70.0120.00919.55
8.4.60.0040.00418.80
8.4.50.0150.00718.42
8.4.40.0060.00319.27
8.4.30.0090.00620.43
8.4.20.0100.01019.08
8.4.10.0030.00617.57
8.3.250.0140.00518.75
8.3.240.0090.01016.50
8.3.230.0060.00316.72
8.3.220.0110.00617.20
8.3.210.0090.00916.57
8.3.200.0060.00216.69
8.3.190.0080.00817.04
8.3.180.0040.00516.51
8.3.170.0030.00720.81
8.3.160.0040.01517.31
8.3.150.0030.00617.41
8.3.140.0080.00016.67
8.3.130.0030.00616.63
8.3.120.0040.00419.00
8.3.110.0050.00316.90
8.3.100.0070.00320.17
8.3.90.0040.00426.77
8.3.80.0090.00019.36
8.3.70.0090.00618.48
8.3.60.0120.00318.55
8.3.50.0080.00917.45
8.3.40.0090.00618.46
8.3.30.0090.00618.86
8.3.20.0050.00321.73
8.3.10.0070.00718.90
8.3.00.0080.00021.76
8.2.290.0100.01020.72
8.2.280.0040.00418.49
8.2.270.0130.00317.39
8.2.260.0060.01216.43
8.2.250.0060.01018.43
8.2.240.0130.00316.51
8.2.230.0090.00620.94
8.2.220.0090.00024.06
8.2.210.0040.00426.77
8.2.200.0060.00318.88
8.2.190.0060.00918.44
8.2.180.0110.00725.92
8.2.170.0070.00722.96
8.2.160.0070.00722.15
8.2.150.0070.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.77
8.2.110.0050.00521.12
8.2.100.0040.00818.03
8.2.90.0040.00417.88
8.2.80.0060.00318.73
8.2.70.0030.00618.03
8.2.60.0040.00418.22
8.2.50.0000.00719.32
8.2.40.0000.00821.21
8.2.30.0000.00919.41
8.2.20.0080.00018.13
8.2.10.0000.00819.13
8.2.00.0040.00418.26
8.1.330.0100.01016.73
8.1.320.0090.00516.43
8.1.310.0060.01218.32
8.1.300.0060.00318.11
8.1.290.0100.00030.84
8.1.280.0060.01225.92
8.1.270.0040.00420.88
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00322.25
8.1.230.0110.00018.99
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.25
8.1.190.0030.00517.23
8.1.180.0000.00918.98
8.1.170.0070.00318.64
8.1.160.0050.00319.07
8.1.150.0070.00018.92
8.1.140.0070.00020.32
8.1.130.0000.00720.31
8.1.120.0040.00317.54
8.1.110.0000.00817.42
8.1.100.0040.00417.38
8.1.90.0040.00717.42
8.1.80.0030.00517.57
8.1.70.0050.00217.41
8.1.60.0060.00317.64
8.1.50.0000.00817.62
8.1.40.0000.00917.45
8.1.30.0040.00417.64
8.1.20.0000.00817.71
8.1.10.0070.00017.46
8.1.00.0000.00817.37
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0000.00718.43
8.0.270.0060.00316.85
8.0.260.0030.00318.55
8.0.250.0000.00717.03
8.0.240.0030.00616.91
8.0.230.0030.00716.94
8.0.220.0000.00716.91
8.0.210.0030.00316.96
8.0.200.0000.00717.00
8.0.190.0070.00016.91
8.0.180.0040.00416.96
8.0.170.0030.00616.98
8.0.160.0000.00716.90
8.0.150.0050.00316.86
8.0.140.0040.00416.87
8.0.130.0060.00013.41
8.0.120.0000.00816.94
8.0.110.0000.00716.99
8.0.100.0000.00816.83
8.0.90.0030.00317.06
8.0.80.0030.01317.01
8.0.70.0000.00716.84
8.0.60.0040.00416.82
8.0.50.0030.00516.81
8.0.30.0080.00917.35
8.0.20.0110.00716.99
8.0.10.0000.00816.90
8.0.00.0110.01116.95
7.4.330.0050.00016.67
7.4.320.0030.00316.42
7.4.300.0030.00516.65
7.4.290.0000.00716.54
7.4.280.0100.00016.56
7.4.270.0060.00616.50
7.4.260.0030.00316.64
7.4.250.0040.00416.53
7.4.240.0030.00616.70
7.4.230.0030.00316.55
7.4.220.0050.00316.61
7.4.210.0100.00816.61
7.4.200.0040.00416.48
7.4.160.0080.01016.48
7.4.140.0090.01217.86
7.4.130.0110.00616.47
7.4.120.0100.00816.33
7.4.110.0090.01016.41
7.4.100.0110.00716.35
7.4.90.0080.01316.44
7.4.80.0090.01317.81
7.4.70.0130.00516.54
7.4.60.0100.01016.48
7.4.50.0080.00916.48
7.4.40.0150.00816.54
7.4.30.0140.01016.37
7.4.20.0140.01416.38
7.4.10.0120.01516.78
7.4.00.0110.00915.30
7.3.330.0000.00513.40
7.3.320.0060.00013.42
7.3.310.0000.00716.38
7.3.300.0040.00416.47
7.3.290.0030.00316.51
7.3.280.0070.01116.40
7.3.260.0090.01116.57
7.3.250.0170.00716.63
7.3.240.0090.00916.45
7.3.230.0100.00816.42
7.3.220.0180.00016.42
7.3.210.0120.00616.37
7.3.200.0100.01116.37
7.3.190.0070.01416.42
7.3.180.0170.01916.39
7.3.170.0100.01216.51
7.3.160.0050.01516.40
7.3.150.0120.00916.29
7.3.140.0140.01116.53
7.3.130.0070.01116.56
7.3.120.0120.00615.34
7.3.110.0070.01215.47
7.3.100.0110.00815.31
7.3.90.0100.00715.32
7.3.80.0050.00915.37
7.3.70.0080.00615.41
7.3.60.0120.00615.42
7.3.50.0060.01115.23
7.3.40.0100.00915.20
7.3.30.0040.00915.29
7.3.20.0080.00916.57
7.3.10.0110.00716.52
7.3.00.0070.01016.52
7.2.340.0160.01216.47
7.2.330.0140.00816.58
7.2.320.0090.01216.46
7.2.310.0140.00716.65
7.2.300.0120.01016.39
7.2.290.0150.01116.54
7.2.280.0260.01016.23
7.2.270.0170.01316.27
7.2.260.0170.01216.56
7.2.250.0070.01415.37
7.2.240.0100.01115.48
7.2.230.0130.00715.56
7.2.220.0120.00615.50
7.2.210.0100.00715.50
7.2.200.0120.00415.44
7.2.190.0090.00915.53
7.2.180.0080.00815.41
7.2.170.0070.01115.36
7.2.160.0140.00615.70
7.2.150.0140.00716.70
7.2.140.0190.00416.78
7.2.130.0110.00916.66
7.2.120.0160.00616.73
7.2.110.0180.00716.67
7.2.100.0110.01016.83
7.2.90.0190.01316.75
7.2.80.0160.00616.61
7.2.70.0140.01616.76
7.2.60.0130.00816.56
7.2.50.0180.00716.64
7.2.40.0140.01016.69
7.2.30.0150.00516.69
7.2.20.0100.01016.75
7.2.10.0110.00916.49
7.2.00.0080.01216.63
7.1.330.0120.01015.75
7.1.320.0080.00815.82
7.1.310.0110.00815.66
7.1.300.0080.00815.72
7.1.290.0110.01015.70
7.1.280.0110.00715.65
7.1.270.0110.00715.67
7.1.260.0100.00615.62
7.1.250.0140.00715.59
7.1.240.0330.00315.32
7.1.230.0280.00915.68
7.1.220.0290.00015.41
7.1.210.0270.00815.54
7.1.200.0190.01015.26
7.1.190.0190.01415.44
7.1.180.0220.00415.34
7.1.170.0260.00715.48
7.1.160.0110.01215.55
7.1.150.0060.01615.38
7.1.140.0090.01315.59
7.1.130.0200.01015.53
7.1.120.0130.01615.44
7.1.110.0100.01315.65
7.1.100.0110.01215.52
7.1.90.0190.00815.71
7.1.80.0230.00715.60
7.1.70.0130.01015.32
7.1.60.0120.01015.67
7.1.50.0160.00615.40
7.1.40.0130.01015.54
7.1.30.0240.00015.67
7.1.20.0150.00915.55
7.1.10.0190.00315.54
7.1.00.0200.00815.45

preferences:
27.99 ms | 403 KiB | 5 Q