3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $time; public function __construct() { $this->time = new \DateTime(); } public function getTime() { return $this->time; } } $start = microtime(true); for ($i = 0; $i < 1000; $i++) { fn(array_pad([], 1500, new Foo)); } $end = microtime(true); echo $end - $start; function fn($priceSeries) { $latest = new \DateTime('+1 year'); $earliest = clone $latest; $earliest->modify('-375 days'); array_filter( $priceSeries, function ($priceValue) use ($earliest, $latest) { return $priceValue->getTime() >= $earliest && $priceValue->getTime() <= $latest; } ); }

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)
7.4.10.0090.00914.89
7.4.00.0090.00914.84
7.3.130.0100.50215.08
7.3.120.0030.46615.24
7.3.110.0100.43815.22
7.3.100.0030.41815.36
7.3.90.0070.49815.23
7.3.80.0070.33315.26
7.3.70.0070.32914.98
7.3.60.0100.31615.29
7.3.50.0070.33315.09
7.3.40.0030.47214.94
7.3.30.0070.44415.07
7.3.20.0070.34116.91
7.3.10.0110.41916.73
7.3.00.0150.35216.68
7.2.260.0070.44515.46
7.2.250.0070.47715.72
7.2.240.0100.54215.72
7.2.230.0000.55715.56
7.2.220.0030.61615.18
7.2.210.0030.54415.70
7.2.200.0030.40115.45
7.2.190.0070.56315.48
7.2.180.0070.56115.16
7.2.170.0000.55115.14
7.2.160.0100.42915.45
7.2.150.0070.58817.24
7.2.140.0070.56917.32
7.2.130.0150.54016.95
7.2.120.0180.55617.05
7.2.110.0120.41116.93
7.2.100.0150.55516.94
7.2.90.0230.46416.97
7.2.80.0130.54317.04
7.2.70.0150.53916.98
7.2.60.0180.49216.83
7.2.50.0270.54617.22
7.2.40.0160.46516.90
7.2.30.0170.51516.94
7.2.20.0280.48316.86
7.2.10.0250.50617.10
7.2.00.0200.54617.09
7.1.330.0030.68915.87
7.1.320.0070.54616.11
7.1.310.0070.59616.10
7.1.300.0030.57415.68
7.1.290.0000.58315.90
7.1.280.0070.73615.91
7.1.270.0070.53216.14
7.1.260.0070.75715.94
7.1.250.0110.63215.86
7.1.240.0000.63915.76
7.1.230.0100.61216.05
7.1.220.0030.62716.02
7.1.210.0030.62016.11
7.1.200.0030.54015.88
7.1.190.0030.67516.12
7.1.180.0130.74915.89
7.1.170.0000.57116.15
7.1.160.0070.69116.06
7.1.150.0030.60016.20
7.1.140.0030.61316.08
7.1.130.0070.61816.05
7.1.120.0000.74916.04
7.1.110.0030.56015.98
7.1.100.0070.75016.08
7.1.90.0070.77015.96
7.1.80.0000.72416.07
7.1.70.0050.43316.62
7.1.60.0120.43917.68
7.1.50.0080.55616.56
7.1.40.0030.67816.13
7.1.30.0070.72515.95
7.1.20.0030.52916.12
7.1.10.0030.66216.02
7.1.00.0030.61719.25
7.0.330.0070.82915.61
7.0.320.0030.73915.55
7.0.310.0030.67315.65
7.0.300.0030.62015.51
7.0.290.0030.85815.47
7.0.280.0000.80715.59
7.0.270.0030.83715.55
7.0.260.0000.80515.45
7.0.250.0070.69815.63
7.0.240.0030.62815.51
7.0.230.0070.58115.66
7.0.220.0070.62915.77
7.0.210.0000.92615.63
7.0.200.0070.56816.12
7.0.190.0000.70515.79
7.0.180.0030.69015.38
7.0.170.0070.76515.77
7.0.160.0070.76715.65
7.0.150.0000.65415.58
7.0.140.0000.73515.65
7.0.130.0030.67715.68
7.0.120.0070.71115.73
7.0.110.0100.55715.50
7.0.100.0030.61115.51
7.0.90.0000.71215.73
7.0.80.0000.79615.54
7.0.70.0030.87115.73
7.0.60.0080.69717.76
7.0.50.0030.67216.81
7.0.40.0080.57717.01
7.0.30.0200.67816.80
7.0.20.0080.64917.00
7.0.10.0120.55716.88
7.0.00.0050.65416.94
5.6.400.0071.55615.10
5.6.390.0001.26615.03
5.6.380.0071.22614.92
5.6.370.0071.55215.08
5.6.360.0031.55714.86
5.6.350.0031.76114.95
5.6.340.0031.25114.86
5.6.330.0001.46014.73
5.6.320.0071.46514.89
5.6.310.0101.61315.07
5.6.300.0071.59414.94
5.6.290.0071.48014.93
5.6.280.0051.18618.09
5.6.270.0071.60014.85
5.6.260.0101.66214.83
5.6.250.0071.46914.98
5.6.240.0001.18114.71
5.6.230.0001.52914.73
5.6.220.0001.64214.70
5.6.210.0101.13317.70
5.6.200.0071.13116.66
5.6.190.0071.20317.75
5.6.180.0101.02617.73
5.6.170.0151.15617.66
5.6.160.0081.05517.67
5.6.150.0071.18116.63
5.6.140.0050.98116.56
5.6.130.0031.16616.72
5.6.120.0121.19918.00
5.6.110.0071.07818.03
5.6.100.0071.24118.03
5.6.90.0101.04818.11
5.6.80.0031.20717.55
5.6.70.2321.06517.57
5.6.60.0071.48714.52
5.6.50.0001.72014.65
5.6.40.0071.25314.64
5.6.30.0071.20814.68
5.6.20.0031.31714.76
5.6.10.0001.43914.68
5.6.00.0001.69414.82
5.5.380.0031.68914.89
5.5.370.0071.46015.05
5.5.360.0031.27414.86
5.5.350.0171.25817.85
5.5.340.0081.17216.57
5.5.330.0051.43517.52
5.5.320.0131.06117.58
5.5.310.0171.03117.70
5.5.300.0081.09716.58
5.5.290.0051.21716.61
5.5.280.0051.16717.90
5.5.270.0101.14617.80
5.5.260.0101.27617.89
5.5.250.0081.27817.82
5.5.240.0101.24017.70
5.5.230.0001.47414.72
5.5.220.0031.76414.59
5.5.210.0071.28214.83
5.5.200.0201.57814.60
5.5.190.0001.42214.52
5.5.180.0001.45314.88
5.5.170.0131.61714.95
5.5.160.0031.28514.73
5.5.150.0031.62414.72
5.5.140.0091.42914.74
5.5.130.0101.59714.77
5.5.120.0101.57314.58
5.5.110.0031.61915.00
5.5.100.0101.75814.89
5.5.90.0071.72914.98
5.5.80.0031.45715.02
5.5.70.0031.65014.56
5.5.60.0131.69214.94
5.5.50.0071.76314.62
5.5.40.0071.59714.68
5.5.30.0171.48514.80
5.5.20.0031.46414.93
5.5.10.0031.86014.66
5.5.00.0071.83114.58
5.4.450.1781.30315.80
5.4.440.1821.27815.71
5.4.430.0121.31315.76
5.4.420.0131.28515.70
5.4.410.0051.54615.59
5.4.400.0101.48515.50
5.4.390.0081.52215.52
5.4.380.0071.72415.50
5.4.370.0121.59515.48
5.4.360.0051.67415.51
5.4.350.0221.69815.37
5.4.340.0031.79615.51
5.4.330.0001.87011.98
5.4.320.0181.89515.40
5.4.310.0101.61115.49
5.4.300.0081.65015.50
5.4.290.0101.66115.42
5.4.280.0151.85515.50
5.4.270.0081.98615.42
5.4.260.0081.80515.39
5.4.250.0121.54915.53
5.4.240.0101.35115.41
5.4.230.0051.50115.51
5.4.220.0071.45415.52
5.4.210.0051.64315.39
5.4.200.0131.56414.38
5.4.190.0121.36015.50
5.4.180.0101.86015.52
5.4.170.0151.42415.42
5.4.160.0121.50215.49
5.4.150.0151.43915.47
5.4.140.0051.69914.30
5.4.130.0121.76814.21
5.4.120.0101.51814.25
5.4.110.0121.44314.35
5.4.100.0121.43914.33
5.4.90.0021.38914.21
5.4.80.0101.52414.33
5.4.70.0031.61414.19
5.4.60.0051.48614.27
5.4.50.0031.35414.26
5.4.40.0051.55514.21
5.4.30.0131.14814.25
5.4.20.0101.12214.33
5.4.10.0001.42511.98
5.4.00.0101.36611.98

preferences:
17.68 ms | 401 KiB | 5 Q