3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Given a time, it gives you the time since then in a friendly format. * * @package * @category * @author Dave Marshall * @author $Author: $ * @version $Rev: $ * @since $Date: $ * @link $URL: $ * *============================================ * modified code by * extracting method from Zend_View_Helper_TimeSince class */ function timeSince($time, $from = null) { if ($from == null) { $from = time(); } $time = $from - $time; $chunks = array( array(60 * 60 * 24 * 365 , 'year'), array(60 * 60 * 24 * 30 , 'month'), array(60 * 60 * 24 , 'day'), array(60 * 60 , 'hour'), array(60 , 'minute'), array(1 , 'second') ); for ($i = 0, $j = count($chunks); $i < $j; $i++) { $seconds = $chunks[$i][0]; $name = $chunks[$i][1]; if (($count = floor($time / $seconds)) != 0) { break; } } $print = ($count == 1) ? '1 '.$name : "$count {$name}s"; return $print; } $dt = strtotime('2012-1-11'); echo "since ",timeSince($dt);

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.3.10.0080.00416.58
7.3.00.0060.00616.70
7.2.130.0110.00416.83
7.2.120.0060.00616.66
7.2.110.0080.00816.85
7.2.100.0120.01216.61
7.2.90.0070.01016.94
7.2.80.0140.00717.01
7.2.70.0190.00617.03
7.2.60.0120.00517.03
7.2.50.0260.00816.80
7.2.40.0060.02117.01
7.2.30.0170.00316.75
7.2.20.0230.00316.59
7.2.10.0140.01416.56
7.2.00.0070.01017.22
7.1.250.0130.01015.58
7.1.200.0040.00815.99
7.1.70.0030.00517.24
7.1.60.0070.01619.32
7.1.50.0100.00317.07
7.1.00.0070.07322.31
7.0.200.0050.00517.04
7.0.140.0000.07722.09
7.0.80.0330.05319.88
7.0.70.0130.06320.16
7.0.60.0130.03720.00
7.0.50.0030.03720.30
7.0.40.0100.07320.10
7.0.30.0030.07320.11
7.0.20.0070.03319.94
7.0.10.0100.06720.03
7.0.00.0030.03720.10
5.6.280.0000.07321.10
5.6.230.0030.08320.67
5.6.220.0030.08320.66
5.6.210.0130.03020.57
5.6.200.0000.05321.12
5.6.190.0000.07020.96
5.6.180.0130.06321.14
5.6.170.0130.07321.03
5.6.160.0100.07021.11
5.6.150.0030.08021.06
5.6.140.0030.03721.00
5.6.130.0030.03721.08
5.6.120.0130.07321.13
5.6.110.0030.08321.17
5.6.100.0030.03721.01
5.6.90.0070.07020.93
5.6.80.0030.04320.41
5.6.70.0000.08020.49
5.6.60.0030.05720.42
5.6.50.0070.03320.32
5.6.40.0000.06720.41
5.6.30.0070.05320.37
5.6.20.0100.08020.37
5.6.10.0070.07720.45
5.6.00.0030.07720.39
5.5.370.0100.07320.41
5.5.360.0100.06720.40
5.5.350.0100.03720.43
5.5.340.0000.04320.91
5.5.330.0030.05320.93
5.5.320.0070.07720.93
5.5.310.0070.08020.93
5.5.300.0100.05020.89
5.5.290.0170.06720.79
5.5.280.0030.07020.93
5.5.270.0130.07320.89
5.5.260.0130.07720.77
5.5.250.0030.05020.66
5.5.240.0070.06720.26
5.5.230.0070.06020.03
5.5.220.0030.07020.22
5.5.210.0000.03720.22
5.5.200.0170.07020.23
5.5.190.0100.04020.19
5.5.180.0130.06020.24
5.5.160.0170.06720.27
5.5.150.0070.05320.04
5.5.140.0100.03320.24
5.5.130.0030.04020.23
5.5.120.0130.07320.28
5.5.110.0000.07720.12
5.5.100.0070.06320.09
5.5.90.0070.03020.14
5.5.80.0070.04720.09
5.5.70.0100.04720.10
5.5.60.0230.05019.91
5.5.50.0070.07720.16
5.5.40.0170.06020.11
5.5.30.0070.03320.07
5.5.20.0070.06320.08
5.5.10.0130.06020.04
5.5.00.0100.03020.08
5.4.450.0030.07319.37
5.4.440.0000.03719.17
5.4.430.0030.07319.50
5.4.420.0070.07019.50
5.4.410.0070.06719.16
5.4.400.0170.05319.05
5.4.390.0000.05319.23
5.4.380.0000.06019.03
5.4.370.0000.07319.14
5.4.360.0170.06319.05
5.4.350.0030.06319.16
5.4.340.0030.08019.13
5.4.320.0130.07719.13
5.4.310.0030.08019.14
5.4.300.0030.07018.94
5.4.290.0030.03319.08
5.4.280.0070.07719.18
5.4.270.0070.05019.04
5.4.260.0000.05019.01
5.4.250.0100.04719.21
5.4.240.0100.06319.02
5.4.230.0100.04019.13
5.4.220.0030.04019.17
5.4.210.0070.07318.94
5.4.200.0130.05719.13
5.4.190.0070.05319.11
5.4.180.0100.02718.94
5.4.170.0100.02719.15
5.4.160.0100.03318.93
5.4.150.0030.04318.85
5.4.140.0030.03316.52
5.4.130.0070.06316.50
5.4.120.0030.03016.38
5.4.110.0000.04016.49
5.4.100.0030.03016.38
5.4.90.0030.04016.48
5.4.80.0130.05316.54
5.4.70.0130.05716.40
5.4.60.0070.07016.42
5.4.50.0000.05716.47
5.4.40.0130.06316.38
5.4.30.0030.06016.47
5.4.20.0100.05016.47
5.4.10.0030.07716.41
5.4.00.0030.03015.87
5.3.290.0070.07714.82
5.3.280.0030.04014.53
5.3.270.0070.06714.68
5.3.260.0030.04014.72
5.3.250.0070.04314.72
5.3.240.0030.03714.64
5.3.230.0030.07014.54
5.3.220.0070.08714.57
5.3.210.0070.04314.50
5.3.200.0100.07714.54
5.3.190.0030.05014.58
5.3.180.0070.04014.52
5.3.170.0030.04014.71
5.3.160.0030.03714.58
5.3.150.0000.05014.56
5.3.140.0030.05714.54
5.3.130.0030.04014.68
5.3.120.0030.03314.66
5.3.110.0100.07014.51
5.3.100.0030.04714.10
5.3.90.0100.04314.09
5.3.80.0130.05713.94
5.3.70.0000.04014.02
5.3.60.0030.07714.03
5.3.50.0030.06714.05
5.3.40.0030.03713.99
5.3.30.0130.02713.97
5.3.20.0100.02713.81
5.3.10.0100.02313.77
5.3.00.0100.06713.67
5.2.170.0030.02711.05
5.2.160.0070.02011.14
5.2.150.0100.02011.21
5.2.140.0000.03311.06
5.2.130.0030.02711.22
5.2.120.0170.05011.06
5.2.110.0000.04311.00
5.2.100.0130.04311.17
5.2.90.0030.02710.98
5.2.80.0030.03011.16
5.2.70.0000.03011.17
5.2.60.0030.03311.17
5.2.50.0100.05311.04
5.2.40.0030.05010.92
5.2.30.0070.02310.91
5.2.20.0070.02311.00
5.2.10.0000.02710.91
5.2.00.0000.06310.80
5.1.60.0030.04310.08
5.1.50.0000.02310.00
5.1.40.0070.05010.05
5.1.30.0030.04010.40
5.1.20.0070.02010.48
5.1.10.0030.0209.97
5.1.00.0000.0279.97
5.0.50.0030.0238.65
5.0.40.0030.0238.41
5.0.30.0030.0538.41
5.0.20.0100.0208.41
5.0.10.0000.0278.41
5.0.00.0000.0678.41
4.4.90.0030.0238.41
4.4.80.0030.0338.41
4.4.70.0030.0278.41
4.4.60.0000.0138.41
4.4.50.0070.0078.41
4.4.40.0030.0378.41
4.4.30.0030.0178.41
4.4.20.0030.0108.41
4.4.10.0000.0238.41
4.4.00.0000.0438.41
4.3.110.0030.0138.41
4.3.100.0070.0278.41
4.3.90.0000.0278.41
4.3.80.0000.0378.41
4.3.70.0070.0208.41
4.3.60.0000.0378.41
4.3.50.0000.0338.41
4.3.40.0000.0408.41
4.3.30.0000.0138.41
4.3.20.0000.0178.41
4.3.10.0000.0208.41
4.3.00.0030.0178.41

preferences:
39.3 ms | 400 KiB | 5 Q