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'; } echo time_elapsed_string(date('Y-m-d', strtotime('2014-04-11 05:07:52')));

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.3.60.0100.01018.93
8.3.50.0110.01122.09
8.3.40.0140.00719.39
8.3.30.0100.00319.17
8.3.20.0050.00320.40
8.3.10.0090.00022.12
8.3.00.0080.00022.39
8.2.180.0100.01016.63
8.2.170.0180.00422.96
8.2.160.0110.00422.30
8.2.150.0080.00024.18
8.2.140.0080.00824.66
8.2.130.0000.00826.16
8.2.120.0090.00019.61
8.2.110.0050.00520.52
8.2.100.0040.00818.16
8.2.90.0050.00319.34
8.2.80.0030.00617.97
8.2.70.0070.00317.75
8.2.60.0000.00918.05
8.2.50.0000.00818.07
8.2.40.0000.00818.36
8.2.30.0000.00918.16
8.2.20.0040.00418.08
8.2.10.0000.00819.80
8.2.00.0080.00017.93
8.1.280.0110.01125.92
8.1.270.0040.00421.98
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0030.00623.91
8.1.230.0060.00620.97
8.1.220.0080.00017.91
8.1.210.0040.00418.77
8.1.200.0030.00617.61
8.1.190.0050.00517.78
8.1.180.0050.00318.10
8.1.170.0040.00418.65
8.1.160.0040.00421.95
8.1.150.0080.00018.90
8.1.140.0040.00417.62
8.1.130.0000.00717.86
8.1.120.0000.00717.77
8.1.110.0040.00417.63
8.1.100.0040.00417.70
8.1.90.0020.00517.64
8.1.80.0030.00317.68
8.1.70.0030.00317.69
8.1.60.0060.00317.71
8.1.50.0000.00817.74
8.1.40.0040.00417.72
8.1.30.0000.00717.76
8.1.20.0040.00417.88
8.1.10.0080.00017.68
8.1.00.0030.00517.83
8.0.300.0040.00418.77
8.0.290.0070.00017.40
8.0.280.0000.00718.59
8.0.270.0040.00417.39
8.0.260.0000.00717.09
8.0.250.0000.00717.24
8.0.240.0000.00717.24
8.0.230.0030.00517.22
8.0.220.0000.00817.18
8.0.210.0030.00317.18
8.0.200.0040.00417.13
8.0.190.0000.00717.15
8.0.180.0040.00417.16
8.0.170.0090.00017.17
8.0.160.0000.00817.09
8.0.150.0040.00417.08
8.0.140.0090.00017.09
8.0.130.0030.00613.51
8.0.120.0000.00817.16
8.0.110.0080.00017.02
8.0.100.0040.00417.22
8.0.90.0040.00417.10
8.0.80.0060.00917.14
8.0.70.0030.00517.10
8.0.60.0040.00417.05
8.0.50.0000.00717.22
8.0.30.0140.00917.43
8.0.20.0140.00517.40
8.0.10.0050.00217.14
8.0.00.0110.00716.98
7.4.330.0070.00015.00
7.4.320.0030.00316.64
7.4.300.0040.00416.77
7.4.290.0000.01016.79
7.4.280.0070.00016.70
7.4.270.0020.00516.73
7.4.260.0030.00316.71
7.4.250.0040.00416.77
7.4.240.0040.00416.79
7.4.230.0040.00416.71
7.4.220.0070.01016.73
7.4.210.0060.01116.80
7.4.200.0030.00316.61
7.4.190.0030.00316.87
7.4.160.0000.01516.75
7.4.150.0100.01617.40
7.4.140.0070.01217.86
7.4.130.0110.01116.76
7.4.120.0110.00616.65
7.4.110.0070.01016.75
7.4.100.0120.01016.79
7.4.90.0030.01516.69
7.4.80.0030.01919.39
7.4.70.0110.00816.51
7.4.60.0120.00816.75
7.4.50.0030.00316.63
7.4.40.0040.01222.77
7.4.30.0100.00716.51
7.4.00.0060.00615.32
7.3.330.0060.00013.47
7.3.320.0030.00313.57
7.3.310.0060.00316.47
7.3.300.0020.00516.43
7.3.290.0040.01116.70
7.3.280.0080.01016.53
7.3.270.0120.00417.40
7.3.260.0150.00616.75
7.3.250.0130.01016.77
7.3.240.0040.01416.60
7.3.230.0030.01416.86
7.3.210.0080.01416.82
7.3.200.0030.01419.39
7.3.190.0120.01116.83
7.3.180.0090.00616.72
7.3.170.0080.00816.64
7.3.160.0160.00016.82
7.3.120.0040.01114.95
7.3.10.0080.00416.81
7.3.00.0030.01016.89
7.2.330.0130.00517.02
7.2.320.0150.00416.87
7.2.310.0030.01316.99
7.2.300.0090.00816.91
7.2.290.0040.01217.07
7.2.130.0130.00017.11
7.2.120.0060.00616.98
7.2.110.0090.00317.21
7.2.100.0040.00417.07
7.2.90.0030.01416.96
7.2.80.0000.01417.31
7.2.70.0000.01016.98
7.2.60.0000.01417.06
7.2.50.0060.00617.18
7.2.40.0040.00817.27
7.2.30.0070.00717.29
7.2.20.0000.00917.25
7.2.10.0090.00616.97
7.2.00.0090.00518.23
7.1.250.0040.00815.92
7.1.100.0000.01018.42
7.1.70.0040.00417.00
7.1.60.0060.01219.82
7.1.50.0180.00717.11
7.1.00.0170.08322.34
7.0.200.0050.00216.92
7.0.140.0000.07021.97
7.0.100.0630.07020.01
7.0.90.0400.08720.01
7.0.80.0270.08019.95
7.0.70.0470.07319.93
7.0.60.0170.05019.75
7.0.50.0370.03720.26
7.0.40.0030.04720.06
7.0.30.0070.04020.18
7.0.20.0030.04320.15
7.0.10.0030.04720.11
7.0.00.0000.05320.07
5.6.280.0100.06721.16
5.6.250.0070.07020.55
5.6.240.0170.07320.61
5.6.230.0030.08720.62
5.6.220.0100.08020.71
5.6.210.0170.06720.48
5.6.200.0030.04321.05
5.6.190.0030.05321.19
5.6.180.0070.04021.12
5.6.170.0100.03720.96
5.6.160.0000.04721.04
5.6.150.0130.03021.12
5.6.140.0000.04720.94
5.6.130.0030.04021.09
5.6.120.0070.05020.96
5.6.110.0070.05721.14
5.6.100.0030.04321.02
5.6.90.0030.04320.95
5.6.80.0000.04720.42
5.6.70.0130.04020.34
5.6.60.0000.07020.27
5.6.50.0030.04320.45
5.6.40.0070.03320.39
5.6.30.0030.04320.44
5.6.20.0100.04020.30
5.6.10.0030.04020.39
5.6.00.0070.04020.36
5.5.380.0070.08020.51
5.5.370.0030.08320.43
5.5.360.0130.07720.34
5.5.350.0030.08020.40
5.5.340.0070.04020.94
5.5.330.0000.04020.84
5.5.320.0070.03720.88
5.5.310.0000.04720.74
5.5.300.0100.06720.92
5.5.290.0070.03720.90
5.5.280.0030.04020.84
5.5.270.0000.04320.83
5.5.260.0100.05320.80
5.5.250.0170.04720.74
5.5.240.0030.03720.15
5.5.230.0000.04020.18
5.5.220.0100.03320.22
5.5.210.0100.03320.14
5.5.200.0000.04320.14
5.5.190.0070.07720.26
5.5.180.0130.05720.09
5.5.160.0070.03720.29
5.5.150.0030.03720.19
5.5.140.0070.03320.19
5.5.130.0070.03720.12
5.5.120.0030.03320.24
5.5.110.0100.06720.27
5.5.100.0030.04320.09
5.5.90.0070.03320.09
5.5.80.0000.06320.14
5.5.70.0170.06319.91
5.5.60.0100.06720.17
5.5.50.0070.07320.15
5.5.40.0070.05320.17
5.5.30.0030.08320.06
5.5.20.0070.05320.14
5.5.10.0170.05320.05
5.5.00.0030.07020.12
5.4.450.0030.04019.27
5.4.440.0070.04019.53
5.4.430.0130.06319.51
5.4.420.0030.04019.31
5.4.410.0030.05019.38
5.4.400.0000.04319.05
5.4.390.0030.03718.95
5.4.380.0030.03719.04
5.4.370.0070.03319.13
5.4.360.0000.04018.88
5.4.350.0100.03019.16
5.4.340.0070.03318.88
5.4.320.0070.03719.16
5.4.310.0070.03018.85
5.4.300.0070.03719.22
5.4.290.0030.05718.94
5.4.280.0070.03319.03
5.4.270.0130.03019.18
5.4.260.0030.04019.14
5.4.250.0130.04719.11
5.4.240.0070.09019.13
5.4.230.0030.07718.95
5.4.220.0030.08019.20
5.4.210.0030.06319.16
5.4.200.0130.05719.20
5.4.190.0170.07019.15
5.4.180.0100.05318.89
5.4.170.0100.06319.03
5.4.160.0000.08319.07
5.4.150.0170.04319.16
5.4.140.0070.07716.44
5.4.130.0100.05716.41
5.4.120.0170.06316.45
5.4.110.0100.03716.39
5.4.100.0100.06716.41
5.4.90.0070.07016.49
5.4.80.0070.07016.44
5.4.70.0030.08016.31
5.4.60.0100.05716.36
5.4.50.0100.05316.48
5.4.40.0130.03716.54
5.4.30.0000.04716.48
5.4.20.0030.07716.33
5.4.10.0100.07016.45
5.4.00.0030.08015.86
5.3.290.0030.04314.67
5.3.280.0100.03314.59
5.3.270.0030.08014.74
5.3.260.0070.08014.63
5.3.250.0130.07014.68
5.3.240.0070.05014.55
5.3.230.0100.03714.64
5.3.220.0070.07314.50
5.3.210.0000.09014.59
5.3.200.0070.07714.53
5.3.190.0130.07014.68
5.3.180.0030.07714.63
5.3.170.0030.04714.61
5.3.160.0070.05014.69
5.3.150.0200.06714.54
5.3.140.0070.07014.59
5.3.130.0130.07014.57
5.3.120.0100.07314.67
5.3.110.0070.06014.61
5.3.100.0100.07714.07
5.3.90.0070.07313.96
5.3.80.0130.06714.05
5.3.70.0130.07313.93
5.3.60.0030.07714.01
5.3.50.0030.07714.02
5.3.40.0070.06714.02
5.3.30.0100.06314.05
5.3.20.0000.07713.84
5.3.10.0030.04313.55
5.3.00.0130.07013.74
5.2.170.0070.06711.41
5.2.160.0100.06011.41
5.2.150.0030.05011.41
5.2.140.0000.07011.41
5.2.130.0070.05711.41
5.2.120.0070.03311.41
5.2.110.0030.07011.41
5.2.100.0070.06311.41
5.2.90.0070.06011.41
5.2.80.0030.04711.41
5.2.70.0100.05711.41
5.2.60.0070.05011.41
5.2.50.0030.06011.41
5.2.40.0030.05011.41
5.2.30.0030.05011.41
5.2.20.0030.04311.41
5.2.10.0100.05011.41
5.2.00.0070.05711.41
5.1.60.0070.02711.41
5.1.50.0030.04711.41
5.1.40.0030.05311.41
5.1.30.0070.03011.41
5.1.20.0000.06011.41
5.1.10.0030.05311.41
5.1.00.0070.03011.41
5.0.50.0070.04711.41
5.0.40.0130.02311.41
5.0.30.0030.05311.41
5.0.20.0030.04311.41
5.0.10.0030.02711.41
5.0.00.0070.06311.41
4.4.90.0070.03311.41
4.4.80.0130.01711.41
4.4.70.0070.03011.41
4.4.60.0000.03711.41
4.4.50.0070.03011.41
4.4.40.0030.05311.41
4.4.30.0030.02711.41
4.4.20.0000.03711.41
4.4.10.0000.02011.41
4.4.00.0070.05011.41
4.3.110.0030.03711.41
4.3.100.0030.03711.41
4.3.90.0030.03011.41
4.3.80.0100.04711.41
4.3.70.0030.03311.41
4.3.60.0000.03011.41
4.3.50.0030.03711.41
4.3.40.0070.04711.41
4.3.30.0000.02011.41
4.3.20.0030.03311.41
4.3.10.0130.01711.41
4.3.00.0070.03011.41

preferences:
42.88 ms | 401 KiB | 5 Q