3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['2018-05'=> '15', '2018-06'=> '100']; $b = ['2018-05'=> '5']; $years = array_map(NULL, $a, $b); $years = array_combine(array_keys($a), $years); $differences = array_map(function ($year_diffs) : float { // Did we get a pair to compare? $has_diff = isset($year_diffs[0]) and isset($year_diffs[1]); // If we got a pair then compare, else assume we got one. $diff = $has_diff ? abs($year_diffs[0] - $year_diffs[1]) : $year_diffs[0]; return $diff; }, $years); var_dump($differences);

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.140.0050.00617.44
8.4.130.0120.00817.61
8.4.120.0120.00820.84
8.4.110.0090.00722.54
8.4.100.0110.00918.02
8.4.90.0020.00620.43
8.4.80.0040.00417.84
8.4.70.0130.00819.02
8.4.60.0120.00818.94
8.4.50.0120.00818.87
8.4.40.0090.01217.65
8.4.30.0130.00617.57
8.4.20.0130.00719.27
8.4.10.0060.00320.62
8.3.270.0130.00716.64
8.3.260.0110.00816.77
8.3.250.0110.00618.80
8.3.240.0100.01016.73
8.3.230.0090.00916.60
8.3.220.0080.01017.20
8.3.210.0030.00418.52
8.3.200.0040.00516.78
8.3.190.0120.00618.83
8.3.180.0110.00917.21
8.3.170.0090.00920.52
8.3.160.0100.01018.50
8.3.150.0150.00317.31
8.3.140.0130.00618.55
8.3.130.0050.00318.99
8.3.120.0040.00418.93
8.3.110.0060.00620.94
8.3.100.0060.00316.91
8.3.90.0000.00818.53
8.3.80.0130.00319.36
8.3.70.0040.01116.38
8.3.60.0090.00918.56
8.3.50.0100.00718.12
8.3.40.0000.01518.97
8.3.30.0100.00318.84
8.3.20.0080.00019.23
8.3.10.0030.00521.91
8.3.00.0040.00418.03
8.2.290.0140.00320.33
8.2.280.0130.00718.39
8.2.270.0140.00417.13
8.2.260.0120.00616.57
8.2.250.0030.01016.89
8.2.240.0040.00418.86
8.2.230.0000.00722.58
8.2.220.0060.00324.06
8.2.210.0030.00626.77
8.2.200.0060.00316.75
8.2.190.0140.00716.63
8.2.180.0150.00616.63
8.2.170.0140.00722.96
8.2.160.0090.00619.17
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.00419.95
8.2.120.0040.00426.35
8.2.110.0100.00020.52
8.2.100.0080.00418.03
8.2.90.0000.00918.22
8.2.80.0060.00318.04
8.2.70.0000.00818.04
8.2.60.0000.00818.16
8.2.50.0040.00418.10
8.2.40.0000.00719.18
8.2.30.0050.00219.49
8.2.20.0070.00018.20
8.2.10.0040.00418.09
8.2.00.0000.00719.51
8.1.330.0070.01321.97
8.1.320.0070.00416.46
8.1.310.0090.00918.50
8.1.300.0060.00317.95
8.1.290.0070.00318.88
8.1.280.0100.01025.92
8.1.270.0070.00023.79
8.1.260.0000.00926.35
8.1.250.0000.00828.09
8.1.240.0070.00422.18
8.1.230.0110.00023.91
8.1.220.0040.00417.74
8.1.210.0040.00418.96
8.1.200.0100.00017.23
8.1.190.0000.00917.25
8.1.180.0000.00918.10
8.1.170.0040.00418.58
8.1.160.0000.00718.89
8.1.150.0050.00318.96
8.1.140.0040.00417.79
8.1.130.0000.00718.94
8.1.120.0030.00617.38
8.1.110.0040.00417.50
8.1.100.0000.00717.51
8.1.90.0040.00417.47
8.1.80.0100.00017.47
8.1.70.0000.00817.46
8.1.60.0030.00617.59
8.1.50.0000.00817.44
8.1.40.0000.00817.42
8.1.30.0030.00717.50
8.1.20.0040.00417.61
8.1.10.0050.00317.57
8.1.00.0000.00817.49
8.0.300.0000.00719.68
8.0.290.0030.00716.75
8.0.280.0000.00718.45
8.0.270.0030.00617.12
8.0.260.0030.00317.25
8.0.250.0060.00317.05
8.0.240.0000.00817.02
8.0.230.0030.00317.05
8.0.220.0000.00716.85
8.0.210.0000.00716.89
8.0.200.0070.00016.91
8.0.190.0080.00017.02
8.0.180.0030.00516.98
8.0.170.0090.00316.90
8.0.160.0040.00417.02
8.0.150.0000.00816.84
8.0.140.0050.00316.94
8.0.130.0070.00013.34
8.0.120.0000.00816.95
8.0.110.0000.00716.78
8.0.100.0070.00017.02
8.0.90.0040.00416.89
8.0.80.0080.00817.00
8.0.70.0040.00416.93
8.0.60.0000.00717.02
8.0.50.0040.00416.96
8.0.30.0130.00717.03
8.0.20.0120.01217.40
8.0.10.0000.00717.05
8.0.00.0110.01016.93
7.4.330.0020.00215.55
7.4.320.0000.00616.60
7.4.300.0060.00016.61
7.4.290.0000.00716.57
7.4.280.0000.00816.45
7.4.270.0000.00716.50
7.4.260.0000.00816.46
7.4.250.0000.00716.52
7.4.240.0070.00016.49
7.4.230.0000.00716.60
7.4.220.0060.00316.50
7.4.210.0050.01016.49
7.4.200.0030.00316.50
7.4.160.0080.01216.48
7.4.140.0120.00717.86
7.4.130.0000.01916.44
7.4.120.0090.01116.56
7.4.110.0100.01416.48
7.4.100.0130.00416.54
7.4.90.0150.00616.61
7.4.80.0130.00619.39
7.4.70.0100.00716.61
7.4.60.0070.01116.33
7.4.50.0070.00716.27
7.4.40.0120.00616.42
7.4.00.0040.01014.85
7.3.330.0000.00713.39
7.3.320.0030.00313.23
7.3.310.0030.00316.37
7.3.300.0050.00216.37
7.3.290.0040.00416.18
7.3.280.0070.00716.32
7.3.260.0120.00516.41
7.3.240.0090.01016.47
7.3.230.0180.00016.42
7.3.210.0120.00616.29
7.3.200.0120.00916.33
7.3.190.0060.01016.43
7.3.180.0090.00816.55
7.3.170.0100.00916.38
7.3.160.0120.00316.46
7.3.120.0140.00314.75
7.3.110.0030.01414.94
7.3.100.0060.01214.92
7.3.90.0140.00014.63
7.3.80.0000.01714.92
7.3.70.0070.00714.80
7.3.60.0000.01414.97
7.3.50.0110.00315.00
7.3.40.0040.00814.82
7.3.30.0070.00414.64
7.3.20.0030.01016.72
7.3.10.0080.00816.69
7.3.00.0090.00316.55
7.2.330.0150.00316.82
7.2.320.0150.01416.75
7.2.310.0110.01116.87
7.2.300.0080.00816.83
7.2.290.0120.00916.77
7.2.250.0070.01314.94
7.2.240.0070.01015.25
7.2.230.0080.00315.09
7.2.220.0130.00614.91
7.2.210.0140.00315.21
7.2.200.0030.01015.14
7.2.190.0160.00015.27
7.2.180.0000.01514.78
7.2.170.0070.00715.15
7.2.160.0090.00615.20
7.2.150.0060.00917.04
7.2.140.0040.01516.94
7.2.130.0100.00617.05
7.2.120.0070.00716.86
7.2.110.0040.00716.69
7.2.100.0040.00817.12
7.2.90.0060.00917.00
7.2.80.0070.00716.64
7.2.70.0050.00516.88
7.2.60.0090.00717.10
7.2.50.0070.01116.93
7.2.40.0090.00517.40
7.2.30.0080.00617.67
7.2.20.1290.00917.51
7.2.10.0120.00817.45
7.2.00.0670.01017.57
7.1.330.0060.01015.73
7.1.320.0040.01115.91
7.1.310.0040.01415.81
7.1.300.0030.01515.54
7.1.290.0040.01615.54
7.1.280.0040.00815.63
7.1.270.0070.00315.71
7.1.260.0090.00015.84
7.1.250.0060.00915.79
7.1.240.0100.00315.59
7.1.230.0070.00415.70
7.1.220.0030.00815.49
7.1.210.0060.00915.80
7.1.200.0030.01115.68
7.1.190.0070.00415.69
7.1.180.0040.00415.66
7.1.170.0000.01615.63
7.1.160.1180.01116.15
7.1.150.1140.00916.35
7.1.140.0160.00516.26
7.1.130.1450.00916.35
7.1.120.0050.01116.41
7.1.110.1600.00816.12
7.1.100.1200.01016.07
7.1.90.0770.00715.91
7.1.80.1540.00815.86
7.1.70.0290.00815.50
7.1.60.0200.00424.60
7.1.50.0660.01324.43
7.1.40.0180.01024.23
7.1.30.0790.01024.23
7.1.20.1740.01124.36
7.1.10.0940.00815.25
7.1.00.0280.01015.30
7.0.330.0070.00715.38
7.0.320.0090.00315.48
7.0.310.0060.00915.17
7.0.300.0000.01415.29
7.0.290.0070.00715.46
7.0.280.0080.00315.35
7.0.270.0060.00915.46
7.0.260.0030.01015.16
7.0.250.0030.00615.21
7.0.240.0030.00915.41
7.0.230.0100.00315.59
7.0.220.0030.01015.19
7.0.210.0000.01515.50
7.0.200.0070.00715.24
7.0.190.0060.00915.14
7.0.180.0060.00615.21
7.0.170.0140.00015.41
7.0.160.0060.00615.18
7.0.150.0080.00415.59
7.0.140.0050.00515.29
7.0.130.0070.00715.55
7.0.120.0030.01015.48
7.0.110.0050.00515.39
7.0.100.0110.00315.52
7.0.90.0040.00415.38
7.0.80.0060.00615.26
7.0.70.0030.01315.44
7.0.60.0060.00615.04
7.0.50.0100.00315.33
7.0.40.0040.00813.27
7.0.30.0040.01113.52
7.0.20.0070.00713.49
7.0.10.0040.00813.44
7.0.00.0000.01313.47
5.6.400.0000.00914.30
5.6.390.0060.01014.07
5.6.380.0040.00414.11
5.6.370.0060.00614.43
5.6.360.0030.01014.06
5.6.350.0000.01014.13
5.6.340.0000.01513.96
5.6.330.0000.00914.03
5.6.320.0110.00714.09
5.6.310.0060.00314.08
5.6.300.0090.00014.00
5.6.290.0100.00714.18
5.6.280.0030.00814.09
5.6.270.0160.00014.18
5.6.260.0120.00314.34
5.6.250.0000.00814.12
5.6.240.0100.00314.13
5.6.230.0100.00614.20
5.6.220.0000.01613.96
5.6.210.0030.01014.17
5.6.200.0090.00614.11
5.6.190.0000.01114.26
5.6.180.0000.01514.08
5.6.170.0030.00914.24
5.6.160.0070.01014.11
5.6.150.0090.00614.00
5.6.140.0060.00914.02
5.6.130.0070.00314.24
5.6.120.0100.00314.29
5.6.110.0030.01014.14
5.6.100.0090.00614.04
5.6.90.0090.00314.06
5.6.80.0070.00714.13
5.6.70.0000.00914.16
5.6.60.0000.01413.89
5.6.50.0100.00714.19
5.6.40.0090.00614.11
5.6.30.0030.01214.04
5.6.20.0000.01214.11
5.6.10.0030.00714.01
5.6.00.0040.01114.04

preferences:
31.54 ms | 403 KiB | 5 Q