3v4l.org

run code in 300+ PHP versions simultaneously
<?php $people = [ [1801, 1887], [1943, 1943], [1949, 2001], [1751, 1803], [1881, 1887], [1956, 1983], [1954, 1983], [1801, 1883], [1956, null], [1944, 1983], [1897, 2015], [1965, 1997], [1941, 1982], [1984, null], ]; $populationPerYear = array_reduce( $people, static function($carry, $current) { [$from, $to] = $current; for($i = $from; $i <= $to; $i++) { if (!isset($carry[$i])) { $carry[$i] = 1; } else { $carry[$i]++; } } return $carry; }, [] ); ksort($populationPerYear); $peak = max($populationPerYear); $peakYears = array_filter( $populationPerYear, static function($population) use ($peak) { return $population === $peak; } ); var_dump($peak, $peakYears);

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.3.110.0060.00320.94
8.3.100.0030.00616.49
8.3.90.0100.01018.53
8.3.80.0110.00018.43
8.3.70.0000.01416.63
8.3.60.0110.00718.43
8.3.50.0130.00922.12
8.3.40.0070.00718.62
8.3.30.0070.00718.72
8.3.20.0080.00021.73
8.3.10.0040.00420.29
8.3.00.0050.00323.48
8.2.230.0040.00422.58
8.2.220.0040.00424.06
8.2.210.0130.00426.77
8.2.200.0070.00318.16
8.2.190.0150.00416.63
8.2.180.0130.01018.54
8.2.170.0120.00322.96
8.2.160.0090.00619.46
8.2.150.0060.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00420.89
8.2.110.0060.00321.02
8.2.100.0110.00017.91
8.2.90.0060.00317.63
8.2.80.0000.00818.78
8.2.70.0000.00817.75
8.2.60.0000.01017.60
8.2.50.0030.00517.63
8.2.40.0030.00518.16
8.2.30.0040.00419.46
8.2.20.0050.00218.07
8.2.10.0050.00219.34
8.2.00.0080.00019.25
8.1.290.0000.00918.88
8.1.280.0040.01125.92
8.1.270.0060.00320.69
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0000.01023.96
8.1.230.0060.00622.75
8.1.220.0000.00917.74
8.1.210.0040.00418.77
8.1.200.0050.00517.23
8.1.190.0080.00317.25
8.1.180.0000.00818.10
8.1.170.0000.00817.62
8.1.160.0040.00418.92
8.1.150.0000.00718.98
8.1.140.0040.00422.09
8.1.130.0000.00717.59
8.1.120.0040.00417.39
8.1.110.0000.00717.45
8.1.100.0050.00217.38
8.1.90.0000.00817.38
8.1.80.0000.00817.38
8.1.70.0040.00417.50
8.1.60.0030.00517.62
8.1.50.0040.00417.45
8.1.40.0040.00417.47
8.1.30.0030.00617.55
8.1.20.0060.00317.66
8.1.10.0040.00417.58
8.1.00.0040.00417.39
8.0.300.0000.00818.77
8.0.290.0030.00616.63
8.0.280.0040.00418.45
8.0.270.0000.00817.29
8.0.260.0030.00316.76
8.0.250.0000.00817.00
8.0.240.0040.00417.02
8.0.230.0030.00517.04
8.0.220.0000.00716.89
8.0.210.0000.00716.80
8.0.200.0030.00316.98
8.0.190.0000.00916.98
8.0.180.0040.00416.82
8.0.170.0040.00716.84
8.0.160.0040.00416.91
8.0.150.0070.00016.83
8.0.140.0040.00416.88
8.0.130.0030.00313.23
8.0.120.0050.00316.90
8.0.110.0020.00516.85
8.0.100.0040.00416.73
8.0.90.0060.00316.96
8.0.80.0060.01116.86
8.0.70.0050.00316.74
8.0.60.0040.00416.88
8.0.50.0080.00016.96
8.0.30.0090.00917.12
8.0.20.0100.01017.23
8.0.10.0000.00717.08
8.0.00.0100.01016.76
7.4.330.0000.00615.55
7.4.320.0030.00316.45
7.4.300.0070.00016.67
7.4.290.0000.00816.48
7.4.280.0040.00416.52
7.4.270.0000.00716.63
7.4.260.0080.00016.50
7.4.250.0030.00316.60
7.4.240.0050.00216.53
7.4.230.0000.00716.63
7.4.220.0010.00616.48
7.4.210.0040.01216.57
7.4.200.0030.00316.59
7.4.140.0140.01017.86
7.4.130.0130.00616.50
7.4.120.0100.01016.41
7.4.110.0150.00416.43
7.4.100.0140.00316.70
7.4.90.0060.01216.55
7.4.80.0000.01719.39
7.4.70.0100.00716.63
7.4.60.0120.01216.39
7.4.50.0060.01216.68
7.4.40.0060.01016.57
7.4.00.0080.01014.94
7.3.330.0000.00613.39
7.3.320.0000.00513.23
7.3.310.0030.00316.41
7.3.300.0020.00416.28
7.3.290.0070.00716.40
7.3.280.0090.00616.40
7.3.260.0120.00816.49
7.3.240.0140.00616.51
7.3.230.0100.01016.32
7.3.210.0090.00916.64
7.3.200.0030.02016.35
7.3.190.0060.01216.33
7.3.180.0030.01316.66
7.3.170.0070.01016.39
7.3.160.0130.00416.54
7.3.120.0090.00914.84
7.3.110.0130.00214.95
7.3.100.0080.00614.90
7.3.90.0070.00314.91
7.3.80.0120.00014.88
7.3.70.0070.00514.77
7.3.60.0080.00714.89
7.3.50.0040.01214.72
7.3.40.0060.00914.88
7.3.30.0060.00714.80
7.3.20.0050.01016.52
7.3.10.0070.00716.72
7.3.00.0030.00916.66
7.2.330.0130.00616.79
7.2.320.0030.01416.87
7.2.310.0120.00916.60
7.2.300.0080.01416.69
7.2.290.0030.01416.81
7.2.250.0100.00715.04
7.2.240.0070.01315.27
7.2.230.0090.00915.01
7.2.220.0100.00615.03
7.2.210.0040.01115.22
7.2.200.0060.00815.10
7.2.190.0090.00415.05
7.2.180.0030.01215.15
7.2.170.0020.01015.02
7.2.160.0060.01214.86
7.2.150.0110.00516.80
7.2.140.0090.00317.03
7.2.130.0000.01416.84
7.2.120.0060.00616.83
7.2.110.0090.00516.75
7.2.100.0120.00316.97
7.2.90.0070.01416.86
7.2.80.0040.01116.78
7.2.70.0100.00616.86
7.2.60.0060.00916.98
7.2.50.0100.00716.79
7.2.40.0120.00416.61
7.2.30.0120.00416.85
7.2.20.0090.00916.94
7.2.10.0030.01516.92
7.2.00.0080.00816.70
7.1.330.0050.00915.89
7.1.320.0070.00715.80
7.1.310.0110.00415.58
7.1.300.0080.00615.63
7.1.290.0050.00815.69
7.1.280.0020.01115.90
7.1.270.0040.01215.81
7.1.260.0050.01215.70
7.1.250.0140.00015.70

preferences:
28.94 ms | 403 KiB | 5 Q