3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new StdClass; $dt->now = new DateTime(); $occurredOn = new DateTime(); $dt->lastUpdated = $occurredOn; $dt->remainingHours = $occurredOn; $dt->interval = $dt->now->diff($dt->lastUpdated); $dt->remainingHours->add(new DateInterval("PT4H")); $dt->remainingHours = $dt->remainingHours->diff($dt->now); $dt->remainingHours = timeRemainingInFourHours($dt->remainingHours); $dt->title = formatDateInterval($dt->interval); function timeRemainingInFourHours(DateInterval $interval) { $hours = ""; $minutes = ""; if ($interval->h) { $hours = $interval->format("%h") . " hours"; } if ($interval->i) { $minutes = $interval->format("%i") . " minutes"; } return $hours . $minutes . ' remaining'; } function formatDateInterval(DateInterval $interval) { $result = ""; // ternary? if ($interval->y) { $result .= $interval->format("%y years "); } if ($interval->m) { $result .= $interval->format("%m months "); } if ($interval->d) { $result .= $interval->format("%d days "); } if ($interval->h) { $result .= $interval->format("%h hours "); } if ($interval->i) { $result .= $interval->format("%i minutes "); } if ($interval->s) { $result .= $interval->format("%s seconds "); } else { $result .= "hot off the press"; } return $result; } var_dump($dt);

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.0.110.0030.00517.14
8.0.100.0000.00817.23
8.0.90.0040.00417.19
8.0.80.0060.00917.11
8.0.70.0030.00616.99
8.0.60.0070.00017.04
8.0.50.0040.00417.10
8.0.30.0110.01217.42
8.0.20.0120.00917.40
8.0.10.0050.00217.31
8.0.00.0120.00816.94
7.4.240.0030.00416.74
7.4.230.0000.00816.66
7.4.220.0150.00316.80
7.4.210.0090.00916.75
7.4.200.0030.00316.59
7.4.160.0030.01416.88
7.4.150.0110.01517.40
7.4.140.0140.00417.86
7.4.130.0070.01316.69
7.4.120.0080.01316.83
7.4.110.0040.01416.72
7.4.100.0140.00616.62
7.4.90.0050.01316.75
7.4.80.0000.01819.39
7.4.70.0100.00716.62
7.4.60.0130.01016.79
7.4.50.0000.00816.64
7.4.40.0070.01016.79
7.4.30.0070.01016.93
7.4.00.0000.01515.36
7.3.300.0030.00316.54
7.3.290.0060.00916.58
7.3.280.0090.00616.56
7.3.270.0160.01017.40
7.3.260.0110.01116.59
7.3.250.0100.00816.71
7.3.240.0070.01116.89
7.3.230.0100.00716.61
7.3.210.0130.01316.64
7.3.200.0150.01219.39
7.3.190.0060.01216.73
7.3.180.0110.00916.68
7.3.170.0150.00616.64
7.3.160.0070.01016.96
7.3.10.0070.00716.79
7.3.00.0020.01016.80
7.2.330.0110.00716.98
7.2.320.0080.01317.10
7.2.310.0110.00716.67
7.2.300.0100.00716.64
7.2.290.0080.01217.01
7.2.130.0080.00816.89
7.2.120.0030.01217.08
7.2.110.0110.00417.12
7.2.100.0090.00717.07
7.2.90.0070.00717.15
7.2.80.0050.00817.04
7.2.70.0050.01017.08
7.2.60.0040.00916.98
7.2.50.0090.00716.94
7.2.40.0060.01017.18
7.2.30.0120.00517.04
7.2.20.0090.00516.98
7.2.10.0080.00616.99
7.2.00.0080.00617.86
7.1.250.0090.00515.87
7.1.200.0090.00615.71
7.1.100.0070.00718.29
7.1.70.0000.00817.27
7.1.60.0140.01019.61
7.1.50.0040.02016.91
7.1.00.0030.07722.31
7.0.200.0040.00416.72
7.0.140.0030.07322.18
7.0.60.0100.07720.08
7.0.50.0030.05317.95
7.0.40.0000.05020.24
7.0.30.0570.06720.26
7.0.20.0230.05320.09
7.0.10.0100.04720.24
7.0.00.0000.08320.20
5.6.280.0070.07320.79
5.6.210.0070.07320.76
5.6.200.0070.07718.19
5.6.190.0070.04320.48
5.6.180.0170.04320.48
5.6.170.0230.04320.45
5.6.160.0030.05320.44
5.6.150.0130.06318.13
5.6.140.0070.07318.14
5.6.130.0170.07318.16
5.6.120.0070.08721.00
5.6.110.0030.04321.05
5.6.100.0100.04020.89
5.6.90.0100.03321.11
5.6.80.0070.08020.39
5.6.70.0400.06720.29
5.5.350.0030.08320.44
5.5.340.0130.06318.07
5.5.330.0070.04320.35
5.5.320.0200.07720.34
5.5.310.0200.04320.19
5.5.300.0070.08317.93
5.5.290.0070.08017.98
5.5.280.0070.07720.89
5.5.270.0030.08720.73
5.5.260.0070.05720.89
5.5.250.0070.06720.55
5.5.240.0000.06320.30
5.4.450.0470.04719.53
5.4.440.0230.04019.49
5.4.430.0270.04019.32
5.4.420.0030.04319.39
5.4.410.0170.04319.07
5.4.400.0300.03318.94
5.4.390.0600.04719.07
5.4.380.0700.05718.74
5.4.370.0770.06718.49
5.4.360.0630.07018.73
5.4.350.1030.05718.83
5.4.340.0830.05018.64
5.4.320.0080.03612.52
5.4.310.0060.04012.51
5.4.300.0080.03612.51
5.4.290.0070.03812.52
5.4.280.0100.03212.41
5.4.270.0070.03712.41
5.4.260.0080.04112.41
5.4.250.0080.03912.41
5.4.240.0070.03612.41
5.4.230.0100.03512.40
5.4.220.0060.03712.40
5.4.210.0070.03712.41
5.4.200.0070.03912.40
5.4.190.0070.03412.39
5.4.180.0100.03512.39
5.4.170.0100.03612.41
5.4.160.0060.03512.40
5.4.150.0090.03412.40
5.4.140.0100.03612.08
5.4.130.0080.03712.07
5.4.120.0070.03812.03
5.4.110.0090.04012.02
5.4.100.0090.03812.02
5.4.90.0070.03612.02
5.4.80.0070.04012.03
5.4.70.0100.03912.02
5.4.60.0070.03912.02
5.4.50.0050.03512.02
5.4.40.0050.03612.01
5.4.30.0040.03812.01
5.4.20.0060.04712.00
5.4.10.0100.03312.00
5.4.00.0050.03611.49
5.3.290.0080.04212.80
5.3.280.0080.03712.71
5.3.270.0080.04212.73
5.3.260.0090.03812.72
5.3.250.0100.03412.72
5.3.240.0070.04112.72
5.3.230.0100.04812.71
5.3.220.0110.04312.68
5.3.210.0110.04412.68
5.3.200.0120.04112.68
5.3.190.0070.04112.68
5.3.180.0120.03312.67
5.3.170.0090.03712.67
5.3.160.0130.04012.67
5.3.150.0070.04712.68
5.3.140.0060.03712.66
5.3.130.0060.04012.66
5.3.120.0090.04512.66
5.3.110.0080.04412.66
5.3.100.0070.03912.13
5.3.90.0080.03812.11
5.3.80.0080.03812.10
5.3.70.0050.03812.10
5.3.60.0060.04612.09
5.3.50.0100.03712.04
5.3.40.0080.04312.04
5.3.30.0070.03911.99
5.3.20.0090.03711.77
5.3.10.0060.03811.74
5.3.00.0090.03311.73
5.2.170.0060.0339.24
5.2.160.0020.0369.24
5.2.150.0030.0329.24
5.2.140.0060.0299.23
5.2.130.0030.0319.19
5.2.120.0060.0279.19
5.2.110.0060.0289.20
5.2.100.0050.0299.19
5.2.90.0100.0289.20
5.2.80.0070.0319.18
5.2.70.0070.0329.19
5.2.60.0060.0319.14
5.2.50.0050.0339.11
5.2.40.0090.0279.09
5.2.30.0050.0289.07
5.2.20.0070.0319.06
5.2.10.0040.0298.96
5.2.00.0060.0288.82
5.1.60.0040.0248.10
5.1.50.0010.0278.10
5.1.40.0040.0268.08
5.1.30.0050.0268.43
5.1.20.0080.0328.45
5.1.10.0070.0358.18
5.1.00.0070.0298.18
5.0.50.0070.0286.66
5.0.40.0050.0246.54
5.0.30.0010.0326.34
5.0.20.0050.0206.30
5.0.10.0040.0206.29
5.0.00.0050.0366.28
4.4.90.0030.0184.78
4.4.80.0040.0174.76
4.4.70.0050.0164.76
4.4.60.0050.0174.76
4.4.50.0010.0244.77
4.4.40.0060.0314.71
4.4.30.0020.0164.76
4.4.20.0010.0174.84
4.4.10.0040.0144.85
4.4.00.0030.0244.76
4.3.110.0050.0184.67
4.3.100.0050.0144.66
4.3.90.0020.0154.64
4.3.80.0020.0244.58
4.3.70.0020.0204.63
4.3.60.0040.0144.63
4.3.50.0040.0164.63
4.3.40.0050.0294.54
4.3.30.0010.0213.32
4.3.20.0010.0183.30
4.3.10.0020.0183.25
4.3.00.0130.01713.57

preferences:
36.66 ms | 400 KiB | 5 Q