3v4l.org

run code in 300+ PHP versions simultaneously
<?php function totaal($bedragen, $btw = false) { $ftotaal = array_sum($bedragen); if($btw) { $ftotaal *= 1.19; } return number_format($ftotaal, 2); } $bedragen = array(5.45, 9.95, 34.95); echo 'totaal excl. btw: '.totaal($bedragen).'<br>'; echo 'totaal excl. btw: '.totaal($bedragen), true.'<br>'; // 15-16 kunnen we ook zo schrijven: echo 'totaal excl. btw: '; echo totaal($bedragen); echo '<br>'; echo 'totaal excl. btw: '; echo totaal($bedragen); echo true; // het zelfde als echo '1'; echo '<br>'; ?> <?php // Functie definiƫren function calcTotaal($aBedragen, $bBtw = false) { // Totaal van prijzen berekenen $fTotaal = array_sum($aBedragen); // Controleren of BTW berekend moet worden if($bBtw) { // Het totaal * 1.19 (19% BTW) $fTotaal *= 1.19; } // Geef het berekende totaal terug return number_format($fTotaal, 2); } // Functie aanroepen $aBedragen = array(5.45, 9.95, 34.95); echo 'Totaal excl. BTW: '.calcTotaal($aBedragen).'<br />'; echo 'Totaal incl. BTW: '.calcTotaal($aBedragen, true).'<br />'; // 48-49 kunnen we ook zo schrijven: echo 'Totaal excl. BTW: '; echo calcTotaal($aBedragen); echo '<br />'; echo 'Totaal incl. BTW: '; echo calcTotaal($aBedragen, true); echo '<br />'; ?>

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.10.0100.01017.68
8.3.140.0090.00918.15
8.3.130.0040.00718.39
8.3.120.0090.00920.84
8.3.110.0090.00020.94
8.3.100.0060.00324.06
8.3.90.0110.00726.77
8.3.80.0060.00316.75
8.3.70.0130.00616.58
8.3.60.0140.00716.38
8.3.50.0100.00822.11
8.3.40.0040.01118.97
8.3.30.0070.01019.07
8.3.20.0050.00220.31
8.3.10.0080.00020.52
8.3.00.0040.00419.38
8.2.260.0060.00618.91
8.2.250.0070.01116.48
8.2.240.0090.00316.90
8.2.230.0040.00422.58
8.2.220.0030.00537.54
8.2.210.0040.00426.77
8.2.200.0060.00316.38
8.2.190.0040.01116.58
8.2.180.0120.00325.92
8.2.170.0030.01219.09
8.2.160.0070.00722.96
8.2.150.0000.00825.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00819.66
8.2.110.0030.00822.15
8.2.100.0110.00417.91
8.2.90.0040.00419.21
8.2.80.0000.00818.16
8.2.70.0050.00517.61
8.2.60.0000.00818.16
8.2.50.0000.00818.10
8.2.40.0000.00822.27
8.2.30.0050.00318.13
8.2.20.0080.00017.79
8.2.10.0040.00418.20
8.2.00.0000.00817.92
8.1.300.0090.00616.27
8.1.290.0040.00418.88
8.1.280.0120.00325.92
8.1.270.0090.00020.81
8.1.260.0050.00226.35
8.1.250.0080.00028.09
8.1.240.0040.00423.95
8.1.230.0040.00717.82
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0000.00818.69
8.1.160.0000.00722.08
8.1.150.0030.00519.01
8.1.140.0040.00417.58
8.1.130.0030.00317.89
8.1.120.0020.00517.49
8.1.110.0050.00317.59
8.1.100.0000.00717.49
8.1.90.0040.00417.48
8.1.80.0040.00417.47
8.1.70.0030.00317.51
8.1.60.0060.00317.64
8.1.50.0040.00417.56
8.1.40.0040.00417.65
8.1.30.0000.00817.61
8.1.20.0000.00817.63
8.1.10.0000.00817.53
8.1.00.0080.00017.45
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.51
8.0.270.0030.00317.39
8.0.260.0000.00717.24
8.0.250.0030.00317.05
8.0.240.0070.00016.96
8.0.230.0070.00016.88
8.0.220.0000.00716.89
8.0.210.0040.00416.95
8.0.200.0040.00417.07
8.0.190.0000.00716.99
8.0.180.0030.00316.96
8.0.170.0040.00416.88
8.0.160.0040.00417.00
8.0.150.0040.00416.96
8.0.140.0030.00416.93
8.0.130.0000.00513.35
8.0.120.0040.00416.91
8.0.110.0070.00016.96
8.0.100.0070.00017.01
8.0.90.0000.00816.92
8.0.80.0060.01016.91
8.0.70.0000.00716.84
8.0.60.0040.00416.92
8.0.50.0040.00416.77
8.0.30.0110.00817.25
8.0.20.0130.00917.46
8.0.10.0080.00016.93
8.0.00.0060.01416.78
7.4.330.0050.00015.20
7.4.320.0000.00716.56
7.4.300.0060.00016.64
7.4.290.0050.00316.66
7.4.280.0050.00316.66
7.4.270.0030.00316.50
7.4.260.0040.00416.63
7.4.250.0000.00716.56
7.4.240.0030.00516.69
7.4.230.0030.00316.32
7.4.220.0000.00716.78
7.4.210.0080.00816.64
7.4.200.0030.00316.67
7.4.160.0120.00516.63
7.4.150.0090.01017.40
7.4.140.0100.00717.86
7.4.130.0100.00816.54
7.4.120.0110.00916.50
7.4.110.0150.00316.64
7.4.100.0150.00616.46
7.4.90.0080.01116.59
7.4.80.0060.01519.39
7.4.70.0160.00316.57
7.4.60.0070.01016.67
7.4.50.0000.00916.52
7.4.40.0070.01016.64
7.4.30.0070.01516.66
7.4.00.0070.01014.83
7.3.330.0000.00613.30
7.3.320.0030.00313.09
7.3.310.0030.00316.33
7.3.300.0000.00716.25
7.3.290.0050.00916.28
7.3.280.0060.01216.27
7.3.270.0090.00917.40
7.3.260.0140.01116.42
7.3.250.0070.01016.45
7.3.240.0100.00716.39
7.3.230.0110.00616.39
7.3.210.0100.00716.52
7.3.200.0110.00819.39
7.3.190.0130.00416.31
7.3.180.0040.01216.32
7.3.170.0120.00616.57
7.3.160.0110.00816.48
7.3.120.0060.00914.97
7.3.110.0040.01114.89
7.3.100.0000.01314.60
7.3.90.0110.00314.62
7.3.80.0070.00414.43
7.3.70.0000.01514.54
7.3.60.0120.00314.52
7.3.50.0090.00314.87
7.3.40.0000.00914.65
7.3.30.0090.00014.65
7.3.20.0040.01116.71
7.3.10.0130.00316.72
7.3.00.0000.01116.55
7.2.330.0090.00916.80
7.2.320.0090.00916.81
7.2.310.0140.00416.77
7.2.300.0150.00816.79
7.2.290.0030.01416.83
7.2.250.0030.01514.90
7.2.240.0120.00914.83
7.2.230.0100.00015.20
7.2.220.0030.00714.93
7.2.210.0070.00414.94
7.2.200.0030.01014.83
7.2.190.0030.01214.80
7.2.180.0030.01315.14
7.2.170.0090.00614.98
7.2.60.0030.01016.93
7.2.00.0000.01419.33
7.1.330.0090.00615.78
7.1.320.0070.01015.86
7.1.310.0000.01315.92
7.1.300.0040.01115.76
7.1.290.0030.01315.77
7.1.280.0080.00615.43
7.1.270.0040.01215.83
7.1.260.0000.01515.99
7.1.200.0130.00015.85
7.1.100.0070.01017.90
7.1.70.0000.01217.31
7.1.60.0070.01819.18
7.1.50.0110.01116.59
7.1.00.0100.07022.24
7.0.200.0090.00316.57
7.0.140.0030.07022.08
7.0.100.0070.08019.95
7.0.90.0100.04719.92
7.0.80.0130.06720.03
7.0.70.0030.09319.98
7.0.60.0170.07019.79
7.0.50.0130.05320.36
7.0.40.0100.04020.05
7.0.30.0000.05720.08
7.0.20.0070.03720.09
7.0.10.0030.04020.06
7.0.00.0000.04719.99
5.6.280.0070.07021.05
5.6.250.0070.07320.61
5.6.240.0030.09020.70
5.6.230.0170.07320.64
5.6.220.0030.09020.48
5.6.210.0030.08320.65
5.6.200.0070.04721.10
5.6.190.0000.04721.15
5.6.180.0000.04721.05
5.6.170.0030.04021.10
5.6.160.0000.04021.00
5.6.150.0030.04020.95
5.6.140.0030.04721.04
5.6.130.0100.08021.03
5.6.120.0030.04321.05
5.6.110.0070.09020.95
5.6.100.0030.04320.93
5.6.90.0100.03721.07
5.6.80.0000.04320.45
5.6.70.0100.05020.50
5.6.60.0030.03720.31
5.6.50.0030.06020.34
5.6.40.0070.04720.54
5.6.30.0100.04720.30
5.6.20.0030.06020.38
5.6.10.0130.03320.32
5.6.00.0130.03020.39
5.5.380.0000.08320.50
5.5.370.0130.07720.36
5.5.360.0030.08720.42
5.5.350.0100.08320.44
5.5.340.0100.03720.91
5.5.330.0070.03720.90
5.5.320.0030.04320.94
5.5.310.0030.04320.78
5.5.300.0100.04320.88
5.5.290.0070.05720.92
5.5.280.0030.04320.77
5.5.270.0070.05320.88
5.5.260.0030.04020.86
5.5.250.0030.04320.67
5.5.240.0100.03320.29
5.5.230.0100.04320.19
5.5.220.0000.04320.18
5.5.210.0070.03720.22
5.5.200.0030.04320.13
5.5.190.0070.03720.18
5.5.180.0070.03720.12
5.5.160.0100.03320.14
5.5.150.0000.04320.23
5.5.140.0000.04320.25
5.5.130.0000.04320.25
5.5.120.0000.07320.09
5.5.110.0030.03720.26
5.5.100.0100.03320.06
5.5.90.0100.07720.05
5.5.80.0100.07720.09
5.5.70.0130.06719.98
5.5.60.0100.04719.97
5.5.50.0100.08020.02
5.5.40.0070.08020.06
5.5.30.0100.07320.12
5.5.20.0170.07020.04
5.5.10.0100.08019.98
5.5.00.0200.06020.02
5.4.450.0070.04319.34
5.4.440.0030.04019.43
5.4.430.0030.05019.53
5.4.420.0070.03719.26
5.4.410.0100.03019.41
5.4.400.0000.04019.05
5.4.390.0030.06719.09
5.4.380.0000.04019.23
5.4.370.0030.03319.01
5.4.360.0070.04019.21
5.4.350.0070.03319.09
5.4.340.0030.05719.04
5.4.320.0030.04719.04
5.4.310.0000.04019.05
5.4.300.0000.03719.20
5.4.290.0070.03718.94
5.4.280.0070.03319.20
5.4.270.0030.03319.10
5.4.260.0030.07019.05
5.4.250.0030.06019.22
5.4.240.0000.07719.20
5.4.230.0170.06719.19
5.4.220.0030.08019.10
5.4.210.0170.07019.14
5.4.200.0100.07319.29
5.4.190.0070.07319.10
5.4.180.0100.07018.91
5.4.170.0100.08019.05
5.4.160.0030.07319.09
5.4.150.0030.07719.09
5.4.140.0070.07316.51
5.4.130.0100.06716.48
5.4.120.0170.06716.49
5.4.110.0130.06316.59
5.4.100.0000.07016.46
5.4.90.0030.07716.39
5.4.80.0000.07316.51
5.4.70.0030.07316.37
5.4.60.0030.06716.45
5.4.50.0130.06716.47
5.4.40.0100.07016.32
5.4.30.0030.07316.46
5.4.20.0170.04716.46
5.4.10.0030.07016.48
5.4.00.0270.03715.77
5.3.290.0070.03314.71
5.3.280.0100.07714.62
5.3.270.0100.06314.63
5.3.260.0170.06014.73
5.3.250.0100.07014.65
5.3.240.0070.07314.73
5.3.230.0030.06714.72
5.3.220.0100.06714.57
5.3.210.0070.07014.63
5.3.200.0130.06714.70
5.3.190.0070.05314.60
5.3.180.0100.06714.56
5.3.170.0070.07014.69
5.3.160.0070.07014.70
5.3.150.0100.07014.68
5.3.140.0100.06314.68
5.3.130.0100.07314.55
5.3.120.0100.07314.65
5.3.110.0030.07014.59
5.3.100.0130.05014.09
5.3.90.0130.07014.16
5.3.80.0070.07714.05
5.3.70.0070.06714.14
5.3.60.0030.07714.13
5.3.50.0100.07013.99
5.3.40.0100.07013.89
5.3.30.0130.06713.95
5.3.20.0130.04713.60
5.3.10.0100.06713.72
5.3.00.0030.06713.55
5.2.170.0030.06011.14
5.2.160.0030.04711.38
5.2.150.0030.06311.21
5.2.140.0070.05711.39
5.2.130.0170.04711.35
5.2.120.0100.05311.33
5.2.110.0100.05311.35
5.2.100.0000.06311.29
5.2.90.0000.06711.32
5.2.80.0070.05711.18
5.2.70.0000.06711.17
5.2.60.0070.05711.29
5.2.50.0030.04011.22
5.2.40.0030.05311.12
5.2.30.0100.05311.11
5.2.20.0030.06011.06
5.2.10.0030.05711.10
5.2.00.0070.06310.81
5.1.60.0030.05310.13
5.1.50.0000.05710.23
5.1.40.0100.04710.07
5.1.30.0070.05710.38
5.1.20.0100.05010.35
5.1.10.0070.03310.30
5.1.00.0030.05710.29
5.0.50.0030.0479.78
5.0.40.0030.0479.78
5.0.30.0070.0609.78
5.0.20.0030.0409.78
5.0.10.0030.0439.78
5.0.00.0070.0639.78
4.4.90.0000.0409.78
4.4.80.0000.0279.78
4.4.70.0070.0309.78
4.4.60.0000.0379.78
4.4.50.0030.0339.78
4.4.40.0030.0579.78
4.4.30.0030.0339.78
4.4.20.0000.0379.78
4.4.10.0030.0339.78
4.4.00.0030.0339.78
4.3.110.0000.0379.78
4.3.100.0070.0279.78
4.3.90.0100.0279.78
4.3.80.0000.0439.78
4.3.70.0000.0339.78
4.3.60.0000.0239.78
4.3.50.0070.0339.78
4.3.40.0030.0579.78
4.3.30.0070.0309.78
4.3.20.0000.0379.78
4.3.10.0030.0379.78
4.3.00.0030.0339.78

preferences:
19.36 ms | 403 KiB | 5 Q