3v4l.org

run code in 300+ PHP versions simultaneously
<?php function timeSince($time, $from = null) { if ($from == null) { $from = time(); } $time = $from - $time; $chunks = array( array(60 * 60 * 24 * 365 , 'year'), array(60 * 60 * 24 * 30 , 'month'), array(60 * 60 * 24 , 'day'), array(60 * 60 , 'hour'), array(60 , 'minute'), array(1 , 'second') ); for ($i = 0, $j = count($chunks); $i < $j; $i++) { $seconds = $chunks[$i][0]; $name = $chunks[$i][1]; if (($count = floor($time / $seconds)) != 0) { break; } } $print = ($count == 1) ? '1 '.$name : "$count {$name}s"; return $print; } } $dt = new DateTime('2012-10-11'); var_dump($dt); //echo date('r', $timestamp); //echo $this->timeSince($timestamp);

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)
5.4.340.4400.05018.87
5.4.320.2930.03718.98
5.4.310.2900.03719.15
5.4.300.2530.03318.83
5.4.290.3230.04318.87
5.4.280.2600.03319.15
5.4.270.2670.03719.04
5.4.260.2130.03719.06
5.4.250.2400.03718.98
5.4.240.2930.04018.97
5.4.230.2600.03719.14
5.4.220.3070.04319.29
5.4.210.3130.04018.93
5.4.200.3200.03719.05
5.4.190.2970.03318.85
5.4.180.3200.04019.05
5.4.170.3130.04018.94
5.4.160.3030.03719.19
5.4.150.3170.04019.04
5.4.140.2970.03316.52
5.4.130.3500.04016.41
5.4.120.3070.03316.67
5.4.110.3000.03316.26
5.4.100.3200.03016.45
5.4.90.3200.03316.54
5.4.80.3030.03316.25
5.4.70.3400.03716.57
5.4.60.2930.03716.44
5.4.50.3170.03716.49
5.4.40.3430.04316.43
5.4.30.3330.03316.36
5.4.20.3400.04016.42
5.4.10.2930.02716.51
5.4.00.3100.04015.90
5.3.290.3400.04314.60
5.3.280.3130.04014.75
5.3.270.3200.03714.76
5.3.260.3170.03714.75
5.3.250.2970.03014.73
5.3.240.3100.03314.51
5.3.230.2900.03014.75
5.3.220.2930.03314.49
5.3.210.3170.03714.58
5.3.200.2830.03714.59
5.3.190.2830.03714.66
5.3.180.3070.03714.80
5.3.170.3070.04014.56
5.3.160.3300.05014.49
5.3.150.3200.02714.48
5.3.140.3330.05014.54
5.3.130.3130.03714.48
5.3.120.2900.03314.55
5.3.110.2430.03714.61
5.3.100.3170.03013.96
5.3.90.3300.04714.00
5.3.80.3170.04314.14
5.3.70.2970.03314.04
5.3.60.3200.03313.93
5.3.50.3430.03313.88
5.3.40.3430.04014.19
5.3.30.2730.04713.84
5.3.20.2570.04013.75
5.3.10.2870.04313.58
5.3.00.3130.04013.65
5.2.170.2530.02011.17
5.2.160.2470.02311.13
5.2.150.2730.03711.16
5.2.140.2900.03711.16
5.2.130.2600.02711.19
5.2.120.2870.03311.36
5.2.110.2670.02711.12
5.2.100.2630.02311.04
5.2.90.2770.03011.17
5.2.80.2470.03311.03
5.2.70.2500.03311.18
5.2.60.0000.04311.18
5.2.50.0000.04711.16
5.2.40.0000.03311.12
5.2.30.0070.06010.85
5.2.20.0570.02710.98
5.2.10.2200.03010.86
5.2.00.2200.03010.80
5.1.60.2030.0239.99
5.1.50.2100.0209.90
5.1.40.1970.02310.07
5.1.30.1930.02310.26
5.1.20.2070.03010.32
5.1.10.2200.0239.97
5.1.00.1900.02310.25
5.0.50.1130.0238.56
5.0.40.1130.0208.41
5.0.30.1100.0438.32
5.0.20.0970.0208.15
5.0.10.0870.0208.17
5.0.00.1130.0338.30
4.4.90.1130.0207.23
4.4.80.1200.0207.23
4.4.70.1200.0177.23
4.4.60.1030.0207.23
4.4.50.0930.0177.23
4.4.40.1100.0277.23
4.4.30.0930.0177.23
4.4.20.1100.0177.23
4.4.10.1030.0177.23
4.4.00.0770.0277.23
4.3.110.1200.0237.23
4.3.100.1170.0207.23
4.3.90.1130.0207.23
4.3.80.1170.0277.23
4.3.70.1200.0207.23
4.3.60.1130.0137.23
4.3.50.1000.0137.23
4.3.40.1200.0237.23
4.3.30.0600.0137.23
4.3.20.0470.0177.23
4.3.10.0600.0277.23
4.3.00.0470.0137.23

preferences:
135.62 ms | 1398 KiB | 7 Q