3v4l.org

run code in 300+ PHP versions simultaneously
<?php $then = '2012-03-03 16:02:00'; $now = time(); $diff = $now - $then; function timeago($time) { $periods = array("second", "minute", "hour", "day", "week", "month", "year", "decade"); $lengths = array("60","60","24","7","4.35","12","10"); $now = time(); $difference = $now - $time; $tense = "ago"; for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { $difference /= $lengths[$j]; } $difference = round($difference); if($difference != 1) { $periods[$j].= "s"; } return "$difference $periods[$j] $tense"; } echo timeago($diff); ?>

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)
7.4.00.0120.00614.96
7.3.120.0030.01314.95
7.3.110.0060.01214.88
7.3.100.0090.00615.03
7.3.90.0060.00815.13
7.3.80.0030.01214.77
7.3.70.0090.00614.97
7.3.60.0070.01014.93
7.3.50.0030.01215.00
7.3.40.0040.00814.69
7.3.30.0090.00614.95
7.3.20.0090.00616.75
7.3.10.0060.00616.64
7.3.00.0110.00416.77
7.2.250.0130.00315.01
7.2.240.0040.01515.01
7.2.230.0090.00614.82
7.2.220.0110.00415.33
7.2.210.0040.01415.07
7.2.200.0060.00615.33
7.2.190.0000.00915.20
7.2.180.0000.01615.14
7.2.170.0080.00815.09
7.2.60.0070.00316.95
7.2.00.0030.01019.55
7.1.330.0030.01015.88
7.1.320.0090.00015.96
7.1.310.0030.01415.77
7.1.300.0080.00515.69
7.1.290.0030.00915.67
7.1.280.0100.00315.77
7.1.270.0100.00315.79
7.1.260.0040.01115.80
7.1.200.0000.01215.83
7.1.100.0000.01318.14
7.1.70.0040.00417.09
7.1.60.0070.01719.40
7.1.50.0050.00516.69
7.1.00.0070.07022.34
7.0.200.0360.00414.64
7.0.140.0070.07022.15
7.0.80.0030.04319.93
7.0.70.0070.08020.04
7.0.60.0070.08020.01
7.0.50.0530.04720.26
7.0.40.0170.05020.18
7.0.30.0100.04720.17
7.0.20.0130.07020.14
7.0.10.0070.07020.12
7.0.00.0100.03719.94
5.6.280.0100.06721.09
5.6.230.0100.06020.51
5.6.220.0130.07720.52
5.6.210.0030.07020.46
5.6.200.0130.07721.03
5.6.190.0070.05021.02
5.6.180.0100.08321.02
5.6.170.0070.08321.09
5.6.160.0030.05021.01
5.6.150.0170.04021.06
5.6.140.0070.05321.05
5.6.130.0100.04721.06
5.6.120.0170.07321.03
5.6.110.0170.08021.05
5.6.100.0130.08020.94
5.6.90.0100.08021.09
5.6.80.0030.05720.46
5.6.70.0130.04720.30
5.6.60.0130.06320.43
5.6.50.0200.06020.41
5.6.40.0000.08020.32
5.6.30.0030.06720.30
5.6.20.0070.04020.31
5.6.10.0130.06320.39
5.6.00.0130.07320.42
5.5.370.0170.07020.45
5.5.360.0000.08720.41
5.5.350.0100.07720.37
5.5.340.0070.05020.87
5.5.330.0130.07720.84
5.5.320.0000.06320.92
5.5.310.0100.08020.83
5.5.300.0100.07720.86
5.5.290.0030.04320.92
5.5.280.0130.07720.84
5.5.270.0070.05720.88
5.5.260.0130.07720.79
5.5.250.0070.04720.68
5.5.240.0100.07320.29
5.5.230.0030.08320.25
5.5.220.0170.04320.29
5.5.210.0030.05320.30
5.5.200.0000.07720.13
5.5.190.0100.03720.11
5.5.180.0030.05020.19
5.5.160.0100.05020.25
5.5.150.0070.08020.21
5.5.140.0100.07320.26
5.5.130.0070.08320.25
5.5.120.0130.05720.08
5.5.110.0030.08320.20
5.5.100.0130.07020.12
5.5.90.0100.07320.02
5.5.80.0030.06020.11
5.5.70.0130.07020.07
5.5.60.0100.06720.16
5.5.50.0070.07320.16
5.5.40.0130.06720.06
5.5.30.0100.07019.94
5.5.20.0070.08320.15
5.5.10.0030.06320.12
5.5.00.0100.07019.96
5.4.450.0030.04019.55
5.4.440.0030.04319.23
5.4.430.0000.09019.37
5.4.420.0000.05719.61
5.4.410.0100.07319.17
5.4.400.0100.07719.14
5.4.390.0170.06718.94
5.4.380.0100.07018.96
5.4.370.0070.07319.19
5.4.360.0030.07019.22
5.4.350.0100.08019.29
5.4.340.0000.05019.14
5.4.320.0070.08319.03
5.4.310.0000.05019.22
5.4.300.0030.04719.04
5.4.290.0070.07718.94
5.4.280.0100.04319.31
5.4.270.0070.05318.96
5.4.260.0170.06318.91
5.4.250.0100.07319.29
5.4.240.0130.06719.02
5.4.230.0070.07319.20
5.4.220.0000.08018.93
5.4.210.0130.04319.11
5.4.200.0030.05319.06
5.4.190.0100.07719.02
5.4.180.0100.07019.02
5.4.170.0070.05019.13
5.4.160.0170.07019.22
5.4.150.0070.04319.28
5.4.140.0030.06016.45
5.4.130.0030.07016.47
5.4.120.0130.07016.43
5.4.110.0100.04316.47
5.4.100.0030.04716.41
5.4.90.0000.05016.53
5.4.80.0030.05016.51
5.4.70.0030.07316.45
5.4.60.0130.06016.44
5.4.50.0130.06016.34
5.4.40.0100.07016.50
5.4.30.0070.07016.45
5.4.20.0070.06016.45
5.4.10.0070.07316.51
5.4.00.0100.07015.88
5.3.290.0070.07714.65
5.3.280.0070.08314.71
5.3.270.0030.04314.70
5.3.260.0170.07014.73
5.3.250.0030.07314.64
5.3.240.0130.07014.67
5.3.230.0070.07314.65
5.3.220.0070.04714.55
5.3.210.0130.06714.68
5.3.200.0030.07314.71
5.3.190.0130.04714.68
5.3.180.0070.06014.66
5.3.170.0100.07314.55
5.3.160.0200.05714.68
5.3.150.0100.04714.59
5.3.140.0100.07314.68
5.3.130.0000.08314.69
5.3.120.0100.07014.54
5.3.110.0100.06714.60
5.3.100.0100.06314.16
5.3.90.0070.07314.03
5.3.80.0070.08014.02
5.3.70.0030.05014.13
5.3.60.0070.07013.98
5.3.50.0130.06714.05
5.3.40.0070.04013.86
5.3.30.0130.03014.00
5.3.20.0030.07013.67
5.3.10.0000.04713.71
5.3.00.0070.07013.56
5.2.170.0000.04711.27
5.2.160.0030.06011.38
5.2.150.0070.04311.26
5.2.140.0000.06711.36
5.2.130.0030.05311.20
5.2.120.0030.04311.34
5.2.110.0000.03711.23
5.2.100.0030.06011.25
5.2.90.0070.06011.26
5.2.80.0030.06011.24
5.2.70.0030.06311.32
5.2.60.0000.03311.17
5.2.50.0100.03311.14
5.2.40.0100.05711.24
5.2.30.0030.04011.30
5.2.20.0100.03711.11
5.2.10.0030.06010.91
5.2.00.0070.05711.04
5.1.60.0070.05310.08
5.1.50.0100.05010.23
5.1.40.0000.03310.21
5.1.30.0000.06010.41
5.1.20.0100.05310.44
5.1.10.0070.04710.24
5.1.00.0070.05010.18
5.0.50.0030.0338.83
5.0.40.0000.0378.66
5.0.30.0000.0578.33
5.0.20.0030.0408.40
5.0.10.0030.0378.25
5.0.00.0000.0538.41
4.4.90.0030.0177.47
4.4.80.0000.0337.47
4.4.70.0130.0207.47
4.4.60.0000.0307.47
4.4.50.0000.0207.47
4.4.40.0000.0577.47
4.4.30.0030.0337.47
4.4.20.0000.0237.47
4.4.10.0030.0207.47
4.4.00.0000.0307.47
4.3.110.0030.0207.47
4.3.100.0070.0137.47
4.3.90.0030.0307.47
4.3.80.0100.0477.47
4.3.70.0000.0377.47
4.3.60.0030.0337.47
4.3.50.0000.0207.47
4.3.40.0000.0307.47
4.3.30.0000.0307.47
4.3.20.0000.0207.47
4.3.10.0000.0377.47
4.3.00.0030.0337.47

preferences:
40.18 ms | 400 KiB | 5 Q