3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dt = new StdClass; $dt->now = new DateTime(); $occurredOn = new DateTime(); $dt->lastUpdated = $occurredOn; $dt->lastUpdated = new DateTime('2014-09-23'); $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.0040.00417.09
8.0.100.0040.00417.00
8.0.90.0080.00017.31
8.0.80.0070.01017.23
8.0.70.0040.00417.19
8.0.60.0050.00317.10
8.0.50.0000.00717.20
8.0.30.0120.00917.38
8.0.20.0120.00917.46
8.0.10.0040.00417.06
8.0.00.0050.01417.00
7.4.240.0010.00616.78
7.4.230.0040.00416.80
7.4.220.0060.01216.74
7.4.210.0120.01016.85
7.4.200.0000.00716.48
7.4.160.0110.00616.63
7.4.150.0190.00717.40
7.4.140.0160.00317.86
7.4.130.0090.01116.84
7.4.120.0110.00816.71
7.4.110.0130.00616.64
7.4.100.0100.01316.71
7.4.90.0140.00416.73
7.4.80.0120.00619.39
7.4.70.0110.00716.62
7.4.60.0080.01216.75
7.4.50.0050.00316.78
7.4.40.0110.01116.78
7.4.30.0070.01016.75
7.4.00.0040.00814.87
7.3.300.0030.00316.57
7.3.290.0070.01216.58
7.3.280.0070.00916.57
7.3.270.0160.00917.40
7.3.260.0140.01016.79
7.3.250.0160.00616.80
7.3.240.0180.00216.77
7.3.230.0130.00416.55
7.3.210.0070.01116.69
7.3.200.0040.01619.39
7.3.190.0070.01416.90
7.3.180.0140.00316.97
7.3.170.0100.00716.57
7.3.160.0130.00316.58
7.3.00.0060.00616.88
7.2.330.0110.00716.77
7.2.320.0160.00917.00
7.2.310.0150.00416.99
7.2.300.0160.00216.79
7.2.290.0050.01317.01
7.2.130.0040.01116.95
7.2.120.0070.01117.14
7.2.110.0040.00716.86
7.2.100.0080.00316.82
7.2.90.0070.00717.16
7.2.80.0060.00617.02
7.2.70.0100.00017.10
7.2.60.0090.00516.94
7.2.50.0130.00016.95
7.2.40.0060.00617.10
7.2.30.0000.01417.05
7.2.20.0000.01417.09
7.2.10.0060.00316.98
7.2.00.0060.00718.30
7.1.250.0030.00716.06
7.1.240.0030.00615.90
7.1.230.0070.00715.92
7.1.220.0080.00315.58
7.1.210.0040.00715.96
7.1.200.0070.00515.97
7.1.190.0040.00416.02
7.1.180.0080.00416.07
7.1.170.0050.00516.11
7.1.160.0000.01015.89
7.1.150.0060.00615.98
7.1.140.0000.00816.10
7.1.130.0070.00716.13
7.1.120.0040.00815.91
7.1.110.0040.00715.88
7.1.100.0090.00417.13
7.1.90.0060.00315.93
7.1.80.0040.01116.14
7.1.70.0080.00516.57
7.1.60.0080.01017.87
7.1.50.0060.01116.50
7.1.40.0000.00915.84
7.1.30.0000.00916.15
7.1.20.0070.00316.10
7.1.10.0060.00615.92
7.1.00.0090.03819.15
7.0.330.0040.00815.63
7.0.320.0070.00315.33
7.0.310.0070.00315.54
7.0.300.0030.01015.62
7.0.290.0040.01115.68
7.0.280.0070.00315.62
7.0.270.0060.00615.54
7.0.260.0050.00515.61
7.0.250.0030.00715.48
7.0.240.0030.01315.64
7.0.230.0080.00415.48
7.0.220.0070.00715.61
7.0.210.0030.01315.66
7.0.200.0070.00416.31
7.0.190.0030.00715.76
7.0.180.0060.00915.60
7.0.170.0120.00015.76
7.0.160.0040.00815.66
7.0.150.0030.00615.49
7.0.140.0070.03518.89
7.0.130.0030.01015.70
7.0.120.0100.00315.64
7.0.110.0450.02217.84
7.0.100.0350.03617.87
7.0.90.0210.02817.86
7.0.80.0180.02917.88
7.0.70.0250.03817.80
7.0.60.0090.02717.80
7.0.50.0280.03117.93
7.0.40.0030.02516.65
7.0.30.0050.04716.54
7.0.20.0070.03816.76
7.0.10.0030.03716.58
7.0.00.0070.03416.66
5.6.380.0070.00714.50
5.6.370.0050.00814.41
5.6.360.0070.00714.57
5.6.350.0030.00514.74
5.6.340.0030.00714.90
5.6.330.0060.00614.45
5.6.320.0070.01014.23
5.6.310.0090.00614.28
5.6.300.0070.00714.75
5.6.290.0000.01214.43
5.6.280.0060.03817.71
5.6.270.0070.00714.84
5.6.260.0070.03717.77
5.6.250.0130.03017.70
5.6.240.0030.02717.57
5.6.230.0060.02417.67
5.6.220.0050.04517.44
5.6.210.0090.02817.71
5.6.200.0120.02517.54
5.6.190.0010.03117.58
5.6.180.0050.02417.46
5.6.170.0080.03017.74
5.6.160.0070.03517.83
5.6.150.0020.02617.60
5.6.140.0060.02317.52
5.6.130.0080.03317.67
5.6.120.0050.02517.58
5.6.110.0030.05117.60
5.6.100.0100.04017.57
5.6.90.0080.04217.54
5.6.80.0050.02917.17
5.6.70.0110.03317.08
5.6.60.0030.02417.04
5.6.50.0020.02917.13
5.6.40.0020.02617.25
5.6.30.0070.04217.16
5.6.20.0040.02717.22
5.6.10.0110.03117.13
5.6.00.0020.03017.15
5.5.380.0070.03214.43
5.5.370.0040.02014.44
5.5.360.0050.02314.54
5.5.350.0030.02614.47
5.5.340.0110.03314.78
5.5.330.0080.02614.63
5.5.320.0080.03314.60
5.5.310.0060.03614.76
5.5.300.0050.04314.76
5.5.290.0110.03614.70
5.5.280.0000.03614.85
5.5.270.0080.04014.75
5.5.260.0060.04214.72
5.5.250.0050.04114.62
5.5.240.0070.02414.41
5.5.230.0050.04014.25
5.5.220.0040.02114.57
5.5.210.0020.02514.39
5.5.200.0050.02114.35
5.5.190.0020.03314.31
5.5.180.0050.02914.41
5.5.170.0060.00611.18
5.5.160.0070.02214.50
5.5.150.0050.03814.37
5.5.140.0080.03914.40
5.5.130.0030.02414.46
5.5.120.0130.02014.34
5.5.110.0050.02014.22
5.5.100.0090.02014.17
5.5.90.0050.02614.26
5.5.80.0050.02314.13
5.5.70.0060.02314.57
5.5.60.0020.02314.17
5.5.50.0040.02314.39
5.5.40.0070.01814.29
5.5.30.0080.02814.16
5.5.20.0030.03114.26
5.5.10.0040.01914.25
5.5.00.0050.02514.26
5.4.450.0070.04315.41
5.4.440.0060.01815.33
5.4.430.0080.04015.54
5.4.420.0030.04515.52
5.4.410.0040.03715.44
5.4.400.0070.02015.22
5.4.390.0000.03215.29
5.4.380.0030.03415.19
5.4.370.0030.02215.09
5.4.360.0060.03615.14
5.4.350.0030.02915.28
5.4.340.0020.04015.21
5.4.330.0040.00411.18
5.4.320.0070.04215.10
5.4.310.0100.03615.12
5.4.300.0090.03915.21
5.4.290.0100.03215.23
5.4.280.0080.02515.20
5.4.270.0010.02415.19
5.4.260.0030.02315.45
5.4.250.0020.03515.28
5.4.240.0030.02515.29
5.4.230.0050.04015.22
5.4.220.0020.02715.26
5.4.210.0020.03315.24
5.4.200.0020.03515.09
5.4.190.0030.02215.25
5.4.180.0020.02315.16
5.4.170.0050.03315.16
5.4.160.0090.02215.17
5.4.150.0050.02215.16
5.4.140.0030.03013.84
5.4.130.0040.02213.96
5.4.120.0030.02113.85
5.4.110.0070.02213.95
5.4.100.0060.02613.97
5.4.90.0080.02514.04
5.4.80.0050.03813.74
5.4.70.0050.03413.89
5.4.60.0030.01813.73
5.4.50.0020.03213.86
5.4.40.0070.02213.97
5.4.30.0000.02413.91
5.4.20.0100.02813.98
5.4.10.0050.02813.88
5.4.00.0050.02813.75
5.3.290.0080.03312.99
5.3.280.0070.03112.88
5.3.270.0060.02112.94
5.3.260.0030.02812.90
5.3.250.0000.02312.94
5.3.240.0050.02712.96
5.3.230.0070.02613.00
5.3.220.0060.03812.95
5.3.210.0080.03912.90
5.3.200.0070.04212.89
5.3.190.0030.02012.92
5.3.180.0070.03812.80
5.3.170.0070.04212.88
5.3.160.0050.02312.89
5.3.150.0040.01912.87
5.3.140.0050.03312.94
5.3.130.0050.03812.85
5.3.120.0100.03212.88
5.3.110.0020.02812.86
5.3.100.0010.03812.66
5.3.90.0030.02512.66
5.3.80.0050.02512.62
5.3.70.0030.02112.62
5.3.60.0050.02712.59
5.3.50.0060.03812.50
5.3.40.0050.01912.68
5.3.30.0110.03312.54
5.3.20.0050.01812.42
5.3.10.0040.02512.48
5.3.00.0050.04312.53
5.2.170.0050.02011.75
5.2.160.0060.02011.75
5.2.150.0020.02011.75
5.2.140.0020.01711.75
5.2.130.0020.02211.75
5.2.120.0030.02511.75
5.2.110.0000.02911.75
5.2.100.0050.02211.75
5.2.90.0030.01911.75
5.2.80.0000.02111.75
5.2.70.0060.01711.75
5.2.60.0080.02811.75
5.2.50.0030.01811.75
5.2.40.0070.03011.75
5.2.30.0020.02811.75
5.2.20.0030.02511.75
5.2.10.0030.03511.75
5.2.00.0020.01711.75
5.1.60.0020.02011.75
5.1.50.0030.02511.75
5.1.40.0030.02411.75
5.1.30.0030.02111.75
5.1.20.0050.01611.75
5.1.10.0080.02611.75
5.1.00.0080.02811.75
5.0.50.0020.01211.75
5.0.40.0040.01011.75
5.0.30.0010.03611.75
5.0.20.0030.01011.75
5.0.10.0030.02111.75
5.0.00.0050.02211.75
4.4.90.0060.01511.75
4.4.80.0030.00811.75
4.4.70.0020.02211.75
4.4.60.0020.01411.75
4.4.50.0000.01111.75
4.4.40.0000.01611.75
4.4.30.0000.01611.75
4.4.20.0030.01611.75
4.4.10.0000.01811.75
4.4.00.0020.02811.75
4.3.110.0000.02011.75
4.3.100.0000.01011.75
4.3.90.0020.01811.75
4.3.80.0030.01311.75
4.3.70.0030.00911.75
4.3.60.0000.00911.75
4.3.50.0020.01011.75
4.3.40.0000.01811.75
4.3.30.0030.01611.75
4.3.20.0030.00811.75
4.3.10.0050.00711.75
4.3.00.0030.00711.75

preferences:
33.54 ms | 401 KiB | 5 Q