3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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('2013-03-03 09:52:05'); ?>

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.10.0040.01515.21
7.4.00.0080.01215.04
7.3.130.0090.00915.00
7.3.120.0070.01014.85
7.3.110.0110.00615.03
7.3.100.0020.01214.96
7.3.90.0080.00815.10
7.3.80.0070.00315.13
7.3.70.0070.00814.64
7.3.60.0000.01514.79
7.3.50.0060.00614.80
7.3.40.0060.00714.91
7.3.30.0030.01114.76
7.3.20.0060.00816.80
7.3.10.0100.00216.60
7.3.00.0060.00816.79
7.2.260.0070.00715.28
7.2.250.0040.01315.15
7.2.240.0070.00714.95
7.2.230.0080.00614.96
7.2.220.0040.00915.20
7.2.210.0050.00914.96
7.2.200.0050.00815.04
7.2.190.0070.00715.02
7.2.180.0030.00914.95
7.2.170.0000.01215.15
7.2.160.0030.01515.02
7.2.150.0050.00817.03
7.2.140.0040.00817.01
7.2.130.0080.00616.94
7.2.120.0070.00716.96
7.2.110.0070.00716.93
7.2.100.0110.00317.03
7.2.90.0050.00916.94
7.2.80.0080.00816.96
7.2.70.0080.00617.00
7.2.60.0070.00717.05
7.2.50.0070.00717.00
7.2.40.0060.01016.88
7.2.30.0050.00816.95
7.2.20.0110.00517.01
7.2.10.0030.01216.88
7.2.00.0080.00817.82
7.1.330.0100.00515.96
7.1.320.0050.01115.86
7.1.310.0010.00915.56
7.1.300.0030.00915.77
7.1.290.0090.00115.85
7.1.280.0060.00615.95
7.1.270.0090.00615.77
7.1.260.0090.00515.64
7.1.250.0070.00315.91
7.1.240.0040.01115.74
7.1.230.0080.00515.74
7.1.220.0030.01015.87
7.1.210.0050.00715.89
7.1.200.0020.01015.79
7.1.190.0060.00915.91
7.1.180.0050.01115.74
7.1.170.0050.00715.75
7.1.160.0090.00315.90
7.1.150.0070.00615.93
7.1.140.0050.00815.69
7.1.130.0020.01215.71
7.1.120.0030.00815.84
7.1.110.0090.00415.92
7.1.100.0070.00616.44
7.1.90.0020.01115.98
7.1.80.0080.00615.90
7.1.70.0020.00816.25
7.1.60.0070.01016.96
7.1.50.0030.00916.14
7.1.40.0030.00815.68
7.1.30.0020.00715.83
7.1.20.0080.00515.72
7.1.10.0020.01115.79
7.1.00.0060.03017.99
7.0.330.0020.01215.33
7.0.320.0020.01215.36
7.0.310.0070.00415.28
7.0.300.0040.00615.40
7.0.290.0070.00615.42
7.0.280.0080.00615.46
7.0.270.0000.01415.35
7.0.260.0060.00515.39
7.0.250.0020.01115.48
7.0.240.0060.00615.55
7.0.230.0080.00715.53
7.0.220.0060.00515.46
7.0.210.0060.00415.57
7.0.200.0070.00615.18
7.0.190.0040.00415.27
7.0.180.0040.00715.33
7.0.170.0060.00615.39
7.0.160.0080.00615.41
7.0.150.0090.00715.53
7.0.140.0050.02617.68
7.0.130.0030.00615.45
7.0.120.0040.03217.65
7.0.110.0060.00715.44
7.0.100.0040.00915.34
7.0.90.0050.00915.40
7.0.80.0210.02116.88
7.0.70.0250.02816.94
7.0.60.0210.03216.98
7.0.50.0210.03717.07
7.0.40.0080.02215.61
7.0.30.0080.01715.70
7.0.20.0050.01715.66
7.0.10.0080.03215.75
7.0.00.0050.03315.66
5.6.400.0050.00514.34
5.6.390.0050.00714.48
5.6.380.0000.01314.58
5.6.370.0040.00714.23
5.6.360.0080.00314.18
5.6.350.0060.00714.28
5.6.340.0080.00414.62
5.6.330.0050.00714.13
5.6.320.0060.00814.51
5.6.310.0060.00514.23
5.6.300.0080.01014.36
5.6.290.0050.00614.31
5.6.280.0030.03816.67
5.6.270.0050.01014.30
5.6.260.0050.01014.43
5.6.250.0040.01114.48
5.6.240.0050.01214.32
5.6.230.0080.03116.44
5.6.220.0080.02816.56
5.6.210.0030.02516.38
5.6.200.0080.02316.79
5.6.190.0040.02516.71
5.6.180.0030.03416.60
5.6.170.0050.01916.70
5.6.160.0060.03116.46
5.6.150.0030.02616.69
5.6.140.0040.01816.50
5.6.130.0050.02116.66
5.6.120.0080.03016.59
5.6.110.0080.02116.72
5.6.100.0060.02116.64
5.6.90.0060.03516.54
5.6.80.0070.03116.44
5.6.70.0030.02416.33
5.6.60.0080.01616.34
5.6.50.0060.02316.30
5.6.40.0050.02416.27
5.6.30.0080.02716.43
5.6.20.0050.03316.52
5.6.10.0010.03116.39
5.6.00.0060.01916.32
5.5.380.0070.00714.21
5.5.370.0060.02516.45
5.5.360.0010.03816.42
5.5.350.0080.02216.35
5.5.340.0060.03216.69
5.5.330.0120.02616.62
5.5.320.0080.02916.66
5.5.310.0040.01916.62
5.5.300.0100.02816.49
5.5.290.0060.02016.66
5.5.280.0060.03216.54
5.5.270.0050.02016.47
5.5.260.0080.02916.38
5.5.250.0110.02816.38
5.5.240.0090.02116.38
5.5.230.0050.01916.20
5.5.220.0020.02116.29
5.5.210.0060.02116.35
5.5.200.0090.02816.19
5.5.190.0100.02916.42
5.5.180.0060.02416.21
5.5.170.0040.00914.47
5.5.160.0050.02216.08
5.5.150.0060.02716.38
5.5.140.0100.02216.21
5.5.130.0060.01716.44
5.5.120.0040.02216.26
5.5.110.0010.02016.35
5.5.100.0060.01716.01
5.5.90.0100.01316.16
5.5.80.0030.02416.12
5.5.70.0040.01916.02
5.5.60.0060.01716.30
5.5.50.0040.01916.26
5.5.40.0070.01616.32
5.5.30.0080.02816.33
5.5.20.0070.02216.09
5.5.10.0040.02216.21
5.5.00.0060.01616.19
5.4.450.0030.03014.40
5.4.440.0060.03014.38
5.4.430.0090.02914.16
5.4.420.0100.02914.28
5.4.410.0080.02314.21
5.4.400.0080.02714.07
5.4.390.0050.03114.20
5.4.380.0020.02814.24
5.4.370.0020.03114.17
5.4.360.0040.02014.25
5.4.350.0090.02014.18
5.4.340.0040.03014.14
5.4.330.0040.00511.80
5.4.320.0040.01714.25
5.4.310.0040.02214.17
5.4.300.0050.02414.14
5.4.290.0050.01714.07
5.4.280.0040.02014.06
5.4.270.0090.01614.12
5.4.260.0030.01514.08
5.4.250.0040.02414.20
5.4.240.0030.01614.16
5.4.230.0070.01314.20
5.4.220.0100.02214.20
5.4.210.0030.01514.24
5.4.200.0010.02114.22
5.4.190.0040.02414.14
5.4.180.0030.01714.12
5.4.170.0030.01614.18
5.4.160.0060.01514.02
5.4.150.0040.02014.14
5.4.140.0030.01813.18
5.4.130.0020.02313.19
5.4.120.0040.01513.30
5.4.110.0040.01213.32
5.4.100.0060.01713.23
5.4.90.0030.01713.35
5.4.80.0040.02213.34
5.4.70.0040.02013.32
5.4.60.0020.01713.28
5.4.50.0040.01713.33
5.4.40.0010.01813.33
5.4.30.0030.01813.33
5.4.20.0040.01413.24
5.4.10.0000.01713.21
5.4.00.0020.01713.05
5.3.290.0030.02712.57
5.3.280.0020.01812.59
5.3.270.0050.01612.58
5.3.260.0070.01412.56
5.3.250.0030.02012.47
5.3.240.0040.01812.55
5.3.230.0030.01712.53
5.3.220.0050.01712.46
5.3.210.0030.01812.46
5.3.200.0080.01312.49
5.3.190.0070.01812.47
5.3.180.0030.01512.56
5.3.170.0010.01912.47
5.3.160.0050.01512.57
5.3.150.0050.01312.46
5.3.140.0030.01612.53
5.3.130.0020.01912.54
5.3.120.0010.01612.46
5.3.110.0070.01712.52
5.3.100.0050.01712.34
5.3.90.0040.02312.35
5.3.80.0030.01612.31
5.3.70.0000.01812.37
5.3.60.0040.01612.30
5.3.50.0030.01612.26
5.3.40.0030.01712.25
5.3.30.0030.02412.32
5.3.20.0000.01812.24
5.3.10.0040.01712.12
5.3.00.0040.02412.13
5.2.170.0030.03011.26
5.2.160.0030.04011.32
5.2.150.0030.02311.15
5.2.140.0030.03311.46
5.2.130.0030.02711.27
5.2.120.0070.02311.34
5.2.110.0030.05011.33
5.2.100.0100.05311.21
5.2.90.0030.04011.34
5.2.80.0030.05711.27
5.2.70.0100.06311.18
5.2.60.0070.05311.29
5.2.50.0000.04311.14
5.2.40.0070.05711.09
5.2.30.0030.06711.19
5.2.20.0100.06011.20
5.2.10.0070.05710.99
5.2.00.0070.06310.89
5.1.60.0000.04710.06
5.1.50.0030.05310.02
5.1.40.0170.04310.21
5.1.30.0030.04010.46
5.1.20.0000.04010.44
5.1.10.0030.04010.22
5.1.00.0030.05310.34
5.0.50.0000.0508.58
5.0.40.0000.0438.65
5.0.30.0030.0578.45
5.0.20.0130.0378.39
5.0.10.0030.0378.30
5.0.00.0000.0608.44
4.4.90.0030.0277.30
4.4.80.0000.0377.30
4.4.70.0000.0377.30
4.4.60.0030.0277.30
4.4.50.0070.0307.30
4.4.40.0070.0477.30
4.4.30.0030.0337.30
4.4.20.0030.0207.30
4.4.10.0000.0237.30
4.4.00.0000.0577.30
4.3.110.0000.0307.30
4.3.100.0070.0307.30
4.3.90.0070.0307.30
4.3.80.0030.0477.30
4.3.70.0030.0237.30
4.3.60.0030.0307.30
4.3.50.0030.0237.30
4.3.40.0000.0537.30
4.3.30.0000.0377.30
4.3.20.0000.0407.30
4.3.10.0000.0307.30
4.3.00.0100.0237.30

preferences:
37.59 ms | 401 KiB | 5 Q