3v4l.org

run code in 300+ PHP versions simultaneously
<?php function time_elapsed_string($datetime, $full = false) { $now = new DateTime; $ago = new DateTime($datetime); $diff = $now->diff($ago); $diff->w = floor($diff->d / 7); $diff->d -= $diff->w * 7; $string = array( 'y' => 'year', 'm' => 'month', 'w' => 'week', 'd' => 'day', 'h' => 'hour', 'i' => 'minute', 's' => 'second', ); foreach ($string as $k => &$v) { if ($diff->$k) { $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : ''); } else { unset($string[$k]); } } if (!$full) $string = array_slice($string, 0, 1); return $string ? implode(', ', $string) . ' ago' : 'just now'; } $comments_time=2014-04-11 05:07:52 echo time_elapsed_string(date('Y-m-d', strtotime($comments_time)));

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.270.0130.04719.10
5.4.260.0070.05318.79
5.4.250.0170.06318.65
5.4.240.0030.08019.09
5.4.230.0170.06319.00
5.4.220.0100.05719.02
5.4.210.0100.05018.83
5.4.200.0130.06018.85
5.4.190.0070.07718.79
5.4.180.0200.05718.79
5.4.170.0070.05718.95
5.4.160.0130.04718.92
5.4.150.0130.07018.74
5.4.140.0000.06716.43
5.4.130.0100.05016.39
5.4.120.0130.06716.38
5.4.110.0100.05716.45
5.4.100.0070.07016.38
5.4.90.0170.04716.55
5.4.80.0000.05316.46
5.4.70.0070.05316.43
5.4.60.0130.04316.60
5.4.50.0270.04016.43
5.4.40.0100.06716.57
5.4.30.0070.06316.26
5.4.20.0170.05716.62
5.4.10.0130.06316.39
5.4.00.0070.04716.00
5.3.280.0100.04714.68
5.3.270.0070.05714.52
5.3.260.0230.04314.70
5.3.250.0200.05014.79
5.3.240.0200.05714.77
5.3.230.0130.06014.67
5.3.220.0070.05714.43
5.3.210.0070.06314.41
5.3.200.0000.07014.56
5.3.190.0100.07014.80
5.3.180.0130.06014.56
5.3.170.0100.07014.66
5.3.160.0000.05714.66
5.3.150.0170.05014.65
5.3.140.0130.04714.79
5.3.130.0100.06314.55
5.3.120.0070.06714.46
5.3.110.0100.06014.46
5.3.100.0170.06014.05
5.3.90.0170.07014.02
5.3.80.0130.04314.19
5.3.70.0070.05014.10
5.3.60.0100.06014.09
5.3.50.0130.04313.95
5.3.40.0070.05313.86
5.3.30.0130.05014.01
5.3.20.0170.05713.69
5.3.10.0100.04713.82
5.3.00.0170.06313.67
5.2.170.0070.04011.21
5.2.160.0070.04011.23
5.2.150.0130.03711.38
5.2.140.0130.05011.23
5.2.130.0030.06010.94
5.2.120.0030.04311.14
5.2.110.0000.04311.19
5.2.100.0130.04711.06
5.2.90.0100.03711.17
5.2.80.0170.05011.11
5.2.70.0100.05711.18
5.2.60.0130.05011.16
5.2.50.0030.04311.11
5.2.40.0070.04311.06
5.2.30.0070.05711.05
5.2.20.0030.04310.93
5.2.10.0070.04310.85
5.2.00.0100.04010.81
5.1.60.0170.0379.96
5.1.50.0070.03710.10
5.1.40.0130.0339.91
5.1.30.0070.03310.30
5.1.20.0100.04310.45
5.1.10.0030.03710.05
5.1.00.0070.03710.14
5.0.50.0000.0338.52
5.0.40.0070.0238.35
5.0.30.0000.0538.19
5.0.20.0100.0208.13
5.0.10.0130.0308.03
5.0.00.0070.0408.24
4.4.90.0030.0277.60
4.4.80.0070.0177.60
4.4.70.0100.0137.60
4.4.60.0070.0207.60
4.4.50.0030.0307.60
4.4.40.0100.0407.60
4.4.30.0000.0337.60
4.4.20.0030.0277.60
4.4.10.0030.0237.60
4.4.00.0000.0477.60
4.3.110.0000.0237.60
4.3.100.0100.0177.60
4.3.90.0030.0207.60
4.3.80.0070.0307.60
4.3.70.0030.0237.60
4.3.60.0000.0307.60
4.3.50.0000.0277.60
4.3.40.0070.0407.60
4.3.30.0030.0237.60
4.3.20.0030.0207.60
4.3.10.0000.0237.60
4.3.00.0030.0206.52

preferences:
144.28 ms | 1386 KiB | 7 Q