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.0070.05018.65
5.4.260.0070.06018.80
5.4.250.0030.06718.77
5.4.240.0070.08018.95
5.4.230.0130.07318.94
5.4.220.0170.05318.91
5.4.210.0100.05019.09
5.4.200.0130.04718.95
5.4.190.0130.06718.79
5.4.180.0100.07318.74
5.4.170.0130.04718.95
5.4.160.0100.05319.08
5.4.150.0130.05318.77
5.4.140.0130.07016.41
5.4.130.0070.05316.48
5.4.120.0170.04016.31
5.4.110.0070.05316.65
5.4.100.0100.05016.65
5.4.90.0230.04016.41
5.4.80.0070.04716.63
5.4.70.0170.06016.54
5.4.60.0100.06716.39
5.4.50.0130.06716.59
5.4.40.0170.04316.54
5.4.30.0030.05316.43
5.4.20.0200.05316.62
5.4.10.0200.04316.28
5.4.00.0100.06715.83
5.3.280.0030.06014.74
5.3.270.0100.07314.70
5.3.260.0100.07714.46
5.3.250.0130.04714.45
5.3.240.0130.04714.52
5.3.230.0130.05014.74
5.3.220.0100.05014.60
5.3.210.0230.05714.71
5.3.200.0170.04714.71
5.3.190.0030.05714.48
5.3.180.0130.05014.48
5.3.170.0070.05714.66
5.3.160.0030.05714.71
5.3.150.0070.05314.66
5.3.140.0170.06714.65
5.3.130.0100.05314.65
5.3.120.0000.07714.56
5.3.110.0030.05314.63
5.3.100.0100.06014.13
5.3.90.0070.05714.09
5.3.80.0070.05014.00
5.3.70.0070.05314.09
5.3.60.0100.04714.18
5.3.50.0100.04313.87
5.3.40.0170.05313.94
5.3.30.0100.04313.94
5.3.20.0030.05713.78
5.3.10.0170.05013.63
5.3.00.0030.07313.64
5.2.170.0100.03311.38
5.2.160.0130.04711.31
5.2.150.0170.03311.13
5.2.140.0000.04711.23
5.2.130.0030.04311.11
5.2.120.0070.03711.08
5.2.110.0070.04011.29
5.2.100.0070.04711.09
5.2.90.0030.04011.19
5.2.80.0070.04011.07
5.2.70.0130.03711.19
5.2.60.0070.03711.15
5.2.50.0170.05311.26
5.2.40.0130.04711.09
5.2.30.0130.03710.89
5.2.20.0030.06011.03
5.2.10.0200.04011.05
5.2.00.0030.04710.89
5.1.60.0170.0409.98
5.1.50.0030.04010.07
5.1.40.0030.03710.05
5.1.30.0030.03710.51
5.1.20.0030.04010.37
5.1.10.0030.03710.08
5.1.00.0070.03310.00
5.0.50.0070.0338.65
5.0.40.0070.0378.63
5.0.30.0030.0478.39
5.0.20.0000.0308.19
5.0.10.0000.0338.25
5.0.00.0030.0438.27
4.4.90.0070.0275.86
4.4.80.0030.0205.90
4.4.70.0030.0235.81
4.4.60.0000.0335.86
4.4.50.0030.0205.88
4.4.40.0070.0436.49
4.4.30.0000.0236.49
4.4.20.0000.0276.49
4.4.10.0000.0276.49
4.4.00.0000.0336.49
4.3.110.0030.0276.49
4.3.100.0030.0236.49
4.3.90.0100.0176.49
4.3.80.0070.0406.49
4.3.70.0000.0276.49
4.3.60.0070.0276.49
4.3.50.0170.0176.49
4.3.40.0030.0306.49
4.3.30.0000.0276.49
4.3.20.0000.0236.49
4.3.10.0000.0236.49
4.3.00.0100.0236.52

preferences:
139.8 ms | 1386 KiB | 7 Q