3v4l.org

run code in 300+ PHP versions simultaneously
<?php $then = "2013-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.10.0120.00915.01
7.4.00.0070.01014.85
7.3.130.0060.01314.79
7.3.120.0120.00614.96
7.3.110.0120.00615.20
7.3.100.0090.00614.89
7.3.90.0070.01015.02
7.3.80.0070.00714.70
7.3.70.0030.01014.95
7.3.60.0000.01514.91
7.3.50.0130.00314.75
7.3.40.0040.00714.93
7.3.30.0030.01214.95
7.3.20.0040.01116.81
7.3.10.0000.01016.74
7.3.00.0060.00316.53
7.2.260.0070.01014.75
7.2.250.0060.00615.26
7.2.240.0120.00315.21
7.2.230.0090.00615.16
7.2.220.0110.00015.13
7.2.210.0040.01115.22
7.2.200.0030.00614.87
7.2.190.0070.01015.16
7.2.180.0070.00314.79
7.2.170.0060.00615.21
7.2.160.0070.01015.20
7.2.150.0070.00716.93
7.2.140.0090.00917.10
7.2.130.0120.00416.99
7.2.120.0100.00717.09
7.2.110.0030.01016.94
7.2.100.0060.00917.00
7.2.90.0000.01817.02
7.2.80.0070.00716.75
7.2.70.0030.00616.80
7.2.60.0020.00817.06
7.2.50.0080.00417.02
7.2.40.0060.00916.79
7.2.30.0070.01017.09
7.2.20.0060.00616.94
7.2.10.0070.01016.80
7.2.00.0020.00818.04
7.1.330.0090.00315.63
7.1.320.0100.00015.79
7.1.310.0000.01315.85
7.1.300.0030.01015.62
7.1.290.0100.00015.87
7.1.280.0060.00615.98
7.1.270.0100.00615.66
7.1.260.0080.00515.68
7.1.250.0030.01415.87
7.1.240.0120.00415.88
7.1.230.0030.01015.83
7.1.220.0000.01015.77
7.1.210.0100.00315.88
7.1.200.0020.01015.68
7.1.190.0030.01015.99
7.1.180.0030.01315.90
7.1.170.0080.00415.70
7.1.160.0000.01415.66
7.1.150.0000.01415.94
7.1.140.0100.00616.00
7.1.130.0080.00815.70
7.1.120.0040.01115.60
7.1.110.0110.00315.71
7.1.100.0090.00417.07
7.1.90.0030.01015.64
7.1.80.0040.01415.96
7.1.70.0030.00816.69
7.1.60.0050.01417.89
7.1.50.0060.01216.51
7.1.40.0060.00615.85
7.1.30.0090.00315.90
7.1.20.0040.01115.67
7.1.10.0000.01015.93
7.1.00.0030.02619.10
7.0.330.0060.00915.48
7.0.320.0110.00315.30
7.0.310.0040.01115.39
7.0.300.0130.00015.42
7.0.290.0050.00815.45
7.0.280.0040.00415.45
7.0.270.0030.00615.19
7.0.260.0030.01015.26
7.0.250.0070.00415.63
7.0.240.0090.00315.45
7.0.230.0100.00315.40
7.0.220.0030.01015.42
7.0.210.0070.00415.43
7.0.200.0050.00816.17
7.0.190.0080.00415.37
7.0.180.0040.00815.48
7.0.170.0040.01215.55
7.0.160.0040.00415.31
7.0.150.0060.00615.22
7.0.140.0030.04118.77
7.0.130.0070.01015.63
7.0.120.0030.00815.54
7.0.110.0030.01015.55
7.0.100.0190.02417.65
7.0.90.0220.02317.72
7.0.80.0310.04017.81
7.0.70.0310.02717.71
7.0.60.0190.02417.77
7.0.50.0210.02317.77
7.0.40.0080.02816.87
7.0.30.0020.03416.73
7.0.20.0100.04516.65
7.0.10.0100.03816.68
7.0.00.0040.03816.91
5.6.400.0040.01014.32
5.6.390.0070.00714.47
5.6.380.0040.01114.40
5.6.370.0030.00714.55
5.6.360.0130.00014.29
5.6.350.0030.01314.63
5.6.340.0000.01014.17
5.6.330.0000.01014.70
5.6.320.0000.01414.31
5.6.310.0080.00814.80
5.6.300.0070.00714.19
5.6.290.0070.00713.98
5.6.280.0050.04117.64
5.6.270.0070.00714.36
5.6.260.0040.00714.46
5.6.250.0080.02217.65
5.6.240.0050.02517.67
5.6.230.0070.04217.43
5.6.220.0060.04217.53
5.6.210.0020.02417.49
5.6.200.0130.03717.88
5.6.190.0070.04417.80
5.6.180.0050.04217.71
5.6.170.0070.04217.88
5.6.160.0040.04617.66
5.6.150.0050.04017.74
5.6.140.0070.04217.68
5.6.130.0030.04517.71
5.6.120.0050.04617.83
5.6.110.0010.03317.82
5.6.100.0050.03517.73
5.6.90.0080.03717.85
5.6.80.0090.03417.44
5.6.70.0070.04517.22
5.6.60.0070.02817.43
5.6.50.0020.03317.34
5.6.40.0040.04117.34
5.6.30.0090.03917.36
5.6.20.0100.04017.42
5.6.10.0090.03517.27
5.6.00.0080.03717.24
5.5.380.0060.02117.53
5.5.370.0030.04517.48
5.5.360.0070.02517.51
5.5.350.0020.02617.39
5.5.340.0050.04017.57
5.5.330.0060.03317.70
5.5.320.0150.03317.71
5.5.310.0120.04017.69
5.5.300.0080.02317.58
5.5.290.0120.04017.80
5.5.280.0030.04317.73
5.5.270.0070.02317.71
5.5.260.0070.04517.59
5.5.250.0110.04317.56
5.5.240.0080.04417.16
5.5.230.0070.04217.31
5.5.220.0050.04517.23
5.5.210.0100.02217.33
5.5.200.0040.02717.25
5.5.190.0020.04617.25
5.5.180.0100.03817.38
5.5.170.0090.00314.51
5.5.160.0030.04717.26
5.5.150.0050.02517.34
5.5.140.0030.02517.34
5.5.130.0070.02017.26
5.5.120.0050.02317.03
5.5.110.0090.02017.30
5.5.100.0030.02317.06
5.5.90.0020.02917.05
5.5.80.0040.02417.13
5.5.70.0050.02217.32
5.5.60.0030.02517.24
5.5.50.0000.02417.17
5.5.40.0050.02217.32
5.5.30.0050.03517.06
5.5.20.0040.04217.21
5.5.10.0080.02117.25
5.5.00.0050.02317.09
5.4.450.0050.04215.46
5.4.440.0050.04715.30
5.4.430.0020.02315.36
5.4.420.0070.04115.29
5.4.410.0080.03015.28
5.4.400.0020.04215.08
5.4.390.0070.04215.14
5.4.380.0030.03715.14
5.4.370.0080.03115.11
5.4.360.0080.04015.12
5.4.350.0070.03715.17
5.4.340.0030.04415.16
5.4.330.0100.00011.10
5.4.320.0030.02415.16
5.4.310.0070.03215.23
5.4.300.0050.03515.15
5.4.290.0030.02315.19
5.4.280.0000.02515.14
5.4.270.0040.02415.17
5.4.260.0020.02415.06
5.4.250.0030.01815.10
5.4.240.0040.03715.11
5.4.230.0020.02515.03
5.4.220.0000.03615.09
5.4.210.0040.02214.99
5.4.200.0020.02215.18
5.4.190.0050.03915.15
5.4.180.0030.02015.09
5.4.170.0050.02115.16
5.4.160.0080.03115.12
5.4.150.0070.02315.19
5.4.140.0030.03113.79
5.4.130.0030.02313.65
5.4.120.0070.01713.80
5.4.110.0050.02013.80
5.4.100.0080.01713.80
5.4.90.0050.02013.84
5.4.80.0090.01613.78
5.4.70.0040.01813.84
5.4.60.0080.01713.86
5.4.50.0050.03413.77
5.4.40.0050.03113.94
5.4.30.0020.02713.74
5.4.20.0050.02213.86
5.4.10.0050.02413.80
5.4.00.0020.02113.51
5.3.290.0050.04512.88
5.3.280.0020.03612.85
5.3.270.0030.02312.87
5.3.260.0020.02512.88
5.3.250.0030.02812.91
5.3.240.0020.02312.90
5.3.230.0020.02412.87
5.3.220.0020.02312.84
5.3.210.0020.02212.85
5.3.200.0030.02012.85
5.3.190.0050.03512.85
5.3.180.0000.02512.88
5.3.170.0070.02012.90
5.3.160.0030.01812.91
5.3.150.0080.01712.83
5.3.140.0000.02512.85
5.3.130.0030.02012.85
5.3.120.0080.01712.82
5.3.110.0060.01812.89
5.3.100.0030.02212.63
5.3.90.0030.02312.62
5.3.80.0030.02212.59
5.3.70.0030.01912.61
5.3.60.0050.01912.59
5.3.50.0050.01812.57
5.3.40.0020.02212.59
5.3.30.0000.02212.50
5.3.20.0050.01712.35
5.3.10.0020.02212.39
5.3.00.0030.01812.33
5.2.170.0070.02311.36
5.2.160.0030.02711.37
5.2.150.0000.03311.23
5.2.140.0030.03011.27
5.2.130.0070.02311.14
5.2.120.0070.02011.20
5.2.110.0000.03011.18
5.2.100.0130.01311.13
5.2.90.0000.02311.13
5.2.80.0030.02311.09
5.2.70.0000.04311.33
5.2.60.0000.04311.28
5.2.50.0130.05311.01
5.2.40.0030.05711.21
5.2.30.0070.06011.20
5.2.20.0070.04311.08
5.2.10.0030.04311.08
5.2.00.0000.03710.77
5.1.60.0030.04310.46
5.1.50.0030.05310.46
5.1.40.0030.05010.46
5.1.30.0000.03310.46
5.1.20.0000.06310.48
5.1.10.0100.04310.46
5.1.00.0000.05010.46
5.0.50.0030.04310.46
5.0.40.0000.04010.46
5.0.30.0030.05010.46
5.0.20.0070.03310.46
5.0.10.0030.02310.46
5.0.00.0030.05710.46
4.4.90.0000.01710.46
4.4.80.0000.02310.46
4.4.70.0000.04010.46
4.4.60.0070.03310.46
4.4.50.0000.03310.46
4.4.40.0030.02710.46
4.4.30.0030.03310.46
4.4.20.0000.03710.46
4.4.10.0030.01710.46
4.4.00.0000.03010.46
4.3.110.0000.02010.46
4.3.100.0000.03710.46
4.3.90.0070.02310.46
4.3.80.0030.03310.46
4.3.70.0000.01710.46
4.3.60.0070.03010.46
4.3.50.0000.03710.46
4.3.40.0030.04310.46
4.3.30.0030.03710.46
4.3.20.0000.03710.46
4.3.10.0030.03710.46
4.3.00.0000.01710.46

preferences:
41.57 ms | 400 KiB | 5 Q