3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calculate($input) { $count = 0; foreach ($input as $value) if (!empty($value)) $count++; return $count < 3 ? $count * 8.5 : 20; } // VOORBEELD 1: $_SESSION = array(); // simuleren van een SESSION array $_SESSION['input']['1'] = 'JA'; $_SESSION['input']['2'] = ''; $_SESSION['input']['3'] = 'JA'; $_SESSION['input']['4'] = ''; $_SESSION['input']['5'] = ''; $_SESSION['input']['6'] = ''; echo 'Voorbeeld 1: het bedrag is: ' . number_format(calculate($_SESSION['input']), 2, ',', '.') . ' euro.' . "\n"; // VOORBEELD 2: $_SESSION = array(); // simuleren van een SESSION array $_SESSION['input']['1'] = 'NEE'; $_SESSION['input']['2'] = ''; $_SESSION['input']['3'] = 'JA'; $_SESSION['input']['4'] = 'JA'; $_SESSION['input']['5'] = 'NEE'; $_SESSION['input']['6'] = ''; echo 'Voorbeeld 2: het bedrag is: ' . number_format(calculate($_SESSION['input']), 2, ',', '.') . ' euro.' . "\n"; // VOORBEELD 3: $_SESSION = array(); // simuleren van een SESSION array $_SESSION['input']['1'] = ''; $_SESSION['input']['2'] = ''; $_SESSION['input']['3'] = ''; $_SESSION['input']['4'] = ''; $_SESSION['input']['5'] = ''; $_SESSION['input']['6'] = ''; echo 'Voorbeeld 3: het bedrag is: ' . number_format(calculate($_SESSION['input']), 2, ',', '.') . ' euro.' . "\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.10.0030.00617.79
8.3.140.0120.00316.70
8.3.130.0090.00618.36
8.3.120.0080.00020.99
8.3.110.0040.00418.40
8.3.100.0060.00318.19
8.3.90.0050.00326.77
8.3.80.0050.00518.55
8.3.70.0120.00316.63
8.3.60.0070.01418.56
8.3.50.0120.00521.33
8.3.40.0090.00618.88
8.3.30.0030.01020.52
8.3.20.0000.00720.33
8.3.10.0070.00022.04
8.3.00.0040.00422.58
8.2.260.0130.00317.13
8.2.250.0060.00318.66
8.2.240.0090.00317.18
8.2.230.0080.00020.94
8.2.220.0120.00324.06
8.2.210.0110.00726.77
8.2.200.0060.00318.38
8.2.190.0130.00718.41
8.2.180.0110.00718.18
8.2.170.0160.00318.95
8.2.160.0070.01022.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00420.79
8.2.110.0030.00622.23
8.2.100.0040.00717.91
8.2.90.0040.00419.17
8.2.80.0060.00319.41
8.2.70.0040.00417.63
8.2.60.0040.00418.05
8.2.50.0050.00318.07
8.2.40.0000.00818.34
8.2.30.0070.00019.52
8.2.20.0040.00417.76
8.2.10.0030.00517.90
8.2.00.0000.00817.81
8.1.310.0060.00916.64
8.1.300.0080.00816.31
8.1.290.0030.00630.84
8.1.280.0100.00325.92
8.1.270.0030.00623.99
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0100.00023.96
8.1.230.0040.00719.41
8.1.220.0000.00817.91
8.1.210.0000.00818.77
8.1.200.0040.00417.60
8.1.190.0030.00517.55
8.1.180.0050.00518.10
8.1.170.0040.00418.91
8.1.160.0000.00819.06
8.1.150.0040.00418.77
8.1.140.0040.00417.49
8.1.130.0040.00417.44
8.1.120.0050.00317.61
8.1.110.0040.00417.57
8.1.100.0000.00817.62
8.1.90.0070.00017.57
8.1.80.0050.00217.48
8.1.70.0000.00717.54
8.1.60.0050.00517.62
8.1.50.0040.00417.69
8.1.40.0040.00417.59
8.1.30.0040.00417.73
8.1.20.0080.00017.80
8.1.10.0040.00417.68
8.1.00.0040.00417.70
8.0.300.0000.00818.77
8.0.290.0040.00417.28
8.0.280.0000.00718.57
8.0.270.0070.00017.27
8.0.260.0000.00617.05
8.0.250.0050.00216.95
8.0.240.0060.00317.04
8.0.230.0000.00717.11
8.0.220.0000.00817.00
8.0.210.0000.00716.98
8.0.200.0070.00017.04
8.0.190.0070.00016.95
8.0.180.0050.00317.05
8.0.170.0000.00816.96
8.0.160.0040.00416.91
8.0.150.0000.00716.96
8.0.140.0050.00216.88
8.0.130.0050.00013.45
8.0.120.0040.00417.03
8.0.110.0040.00417.04
8.0.100.0000.00717.05
8.0.90.0050.00216.91
8.0.80.0150.00716.90
8.0.70.0000.00817.08
8.0.60.0080.00017.05
8.0.50.0070.00017.12
8.0.30.0120.00617.15
8.0.20.0100.01317.40
8.0.10.0000.00716.98
8.0.00.0150.00716.69
7.4.330.0000.00616.85
7.4.320.0070.00016.63
7.4.300.0000.00616.74
7.4.290.0000.00716.52
7.4.280.0070.00016.52
7.4.270.0070.00016.64
7.4.260.0030.00313.40
7.4.250.0030.00516.68
7.4.240.0010.00616.74
7.4.230.0030.00316.53
7.4.220.0130.01016.77
7.4.210.0080.00616.65
7.4.200.0040.00416.73
7.4.190.0070.00016.79
7.4.160.0130.00716.50
7.4.150.0130.00417.40
7.4.140.0070.01017.86
7.4.130.0080.01116.69
7.4.120.0090.01216.58
7.4.110.0030.01316.60
7.4.100.0070.01016.66
7.4.90.0150.00316.39
7.4.80.0070.01019.39
7.4.70.0030.01816.63
7.4.60.0070.01016.57
7.4.50.0030.00516.70
7.4.40.0030.01322.77
7.4.30.0100.00716.57
7.4.00.0100.00014.81
7.3.330.0000.00513.39
7.3.320.0000.00513.45
7.3.310.0050.00316.41
7.3.300.0000.00716.62
7.3.290.0070.00716.62
7.3.280.0080.01116.54
7.3.270.0070.01017.40
7.3.260.0140.00316.67
7.3.250.0110.00616.66
7.3.240.0060.01716.48
7.3.230.0070.01016.75
7.3.210.0120.00416.86
7.3.200.0120.01219.39
7.3.190.0120.00916.49
7.3.180.0030.01216.65
7.3.170.0100.00616.79
7.3.160.0070.00716.52
7.3.120.0100.00715.20
7.3.10.0090.00616.59
7.3.00.0030.01016.87
7.2.330.0150.00416.70
7.2.320.0090.01216.77
7.2.310.0090.00916.92
7.2.300.0070.01016.96
7.2.290.0140.00317.05
7.2.130.0030.00617.03
7.2.120.0070.00717.16
7.2.110.0030.01017.03
7.2.100.0040.00416.97
7.2.90.0070.00716.98
7.2.80.0000.00916.71
7.2.70.0000.01416.86
7.2.60.0060.00816.95
7.2.50.0000.01817.07
7.2.40.0100.00017.04
7.2.30.0060.00916.98
7.2.20.0040.01117.22
7.2.10.0070.00416.95
7.2.00.0030.00918.34
7.1.250.0060.00915.89
7.1.200.0000.01516.03
7.1.100.0000.01418.13
7.1.70.0070.00017.07
7.1.60.0150.00719.17
7.1.50.0000.02417.11
7.1.00.0000.07722.70
7.0.200.0000.00816.79
7.0.140.0070.07022.23
7.0.60.0100.06321.80
7.0.50.0000.08318.17
7.0.40.0100.08320.43
7.0.30.0230.06020.34
7.0.20.0370.08020.20
7.0.10.0030.04720.22
7.0.00.0170.08320.42
5.6.280.0000.07721.36
5.6.210.0030.05720.79
5.6.200.0000.04318.33
5.6.190.0070.08720.64
5.6.180.0230.08720.53
5.6.170.0070.05020.77
5.6.160.0170.08020.57
5.6.150.0070.04718.42
5.6.140.0070.04018.38
5.6.130.0070.08318.41
5.6.120.0130.06321.24
5.6.110.0070.08021.38
5.6.100.0130.07021.38
5.6.90.0070.08021.22
5.6.80.0100.07720.68
5.5.350.0100.04020.65
5.5.340.0130.07318.22
5.5.330.0030.08720.33
5.5.320.0530.06320.51
5.5.310.0330.07020.56
5.5.300.0030.08318.14
5.5.290.0070.08018.08
5.5.280.0130.07721.12
5.5.270.0030.09020.98
5.5.260.0070.07021.00
5.5.250.0030.04320.74
5.5.240.0070.06720.45
5.4.450.3500.04019.72
5.4.440.0070.03719.41
5.4.430.4070.04319.67
5.4.420.3970.04019.68
5.4.410.3500.04319.27
5.4.400.3730.02719.20
5.4.390.0030.05019.23
5.4.380.2200.03319.27
5.4.370.4070.03719.13
5.4.360.3900.03719.20
5.4.350.3900.03719.36
5.4.340.3830.03719.25
5.4.320.3600.04019.10
5.4.310.3570.03319.23
5.4.300.3800.03319.09
5.4.290.3670.03719.34
5.4.280.3670.03719.05
5.4.270.3830.04019.35
5.4.260.3830.04019.27
5.4.250.3600.03719.34
5.4.240.3830.04719.23
5.4.230.3730.03319.34
5.4.220.4530.03719.25
5.4.210.4470.03019.41
5.4.200.4000.03719.11
5.4.190.3670.03319.40
5.4.180.3600.03719.18
5.4.170.3570.03019.22
5.4.160.3370.03719.38
5.4.150.3530.03719.21
5.4.140.3500.04316.52
5.4.130.3230.03716.65
5.4.120.3500.03316.68
5.4.110.2730.03016.70
5.4.100.3630.03016.39
5.4.90.3470.03716.71
5.4.80.4000.03316.48
5.4.70.3830.03316.68
5.4.60.3830.03316.68
5.4.50.3570.04016.64
5.4.40.4000.03716.70
5.4.30.3570.03016.52
5.4.20.3630.03316.61
5.4.10.3670.03316.72
5.4.00.3970.03315.99
5.3.290.3730.03314.84
5.3.280.4470.02714.83
5.3.270.3670.03714.64
5.3.260.3670.03314.86
5.3.250.3600.03014.79
5.3.240.3600.03314.77
5.3.230.3570.03314.89
5.3.220.3530.03314.73
5.3.210.3300.03714.81
5.3.200.3700.04014.71
5.3.190.4130.03314.86
5.3.180.3570.04014.71
5.3.170.3930.03314.71
5.3.160.3970.03014.73
5.3.150.3770.03014.73
5.3.140.3770.04314.86
5.3.130.3670.04714.69
5.3.120.3930.03014.85
5.3.110.3830.03314.70
5.3.100.3400.03714.22
5.3.90.4470.02714.17
5.3.80.4430.04014.07
5.3.70.4030.05314.32
5.3.60.4000.04314.17
5.3.50.3830.03714.11
5.3.40.3500.04014.09
5.3.30.3930.03714.13
5.3.20.3870.03313.84
5.3.10.3870.03313.84
5.3.00.3600.04013.75
5.2.170.3200.03011.26
5.2.160.3330.03011.24
5.2.150.3200.02311.24
5.2.140.3300.03011.23
5.2.130.3300.03711.24
5.2.120.3270.03311.19
5.2.110.3270.03311.30
5.2.100.2970.03311.24
5.2.90.3130.03311.20
5.2.80.2930.03311.17
5.2.70.3470.02311.27
5.2.60.3630.02711.16
5.2.50.3900.02311.21
5.2.40.3100.03011.06
5.2.30.3130.03011.21
5.2.20.2830.02711.18
5.2.10.2930.03710.93
5.2.00.2230.02310.85
5.1.60.3030.03010.11
5.1.50.3130.02310.12
5.1.40.2470.0239.96
5.1.30.2900.02310.53
5.1.20.2830.02010.44
5.1.10.2330.03010.12
5.1.00.2370.02710.28
5.0.50.1300.0178.77
5.0.40.1700.0238.56
5.0.30.0030.0638.21
5.0.20.0030.0478.27
5.0.10.0030.0408.25
5.0.00.0070.0608.23
4.4.90.1470.0176.06
4.4.80.1800.0136.06
4.4.70.1330.0176.06
4.4.60.1400.0236.06
4.4.50.1230.0106.06
4.4.40.1430.0236.06
4.4.30.1770.0136.06
4.4.20.1130.0206.09
4.4.10.1200.0136.06
4.4.00.1330.0206.06
4.3.110.1230.0176.06
4.3.100.0000.0176.06
4.3.90.0030.0306.06
4.3.80.0000.0276.06
4.3.70.0030.0136.06
4.3.60.0000.0176.06
4.3.50.0000.0176.06
4.3.40.0830.0306.06
4.3.30.0700.0206.06
4.3.20.0600.0176.06
4.3.10.0700.0176.06
4.3.00.0700.0176.06

preferences:
31.88 ms | 403 KiB | 5 Q