3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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-10-11'); echo 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.4.00.0090.00915.14
7.3.120.0040.01515.03
7.3.110.0070.01314.91
7.3.100.0030.01314.99
7.3.90.0070.00715.19
7.3.80.0030.01315.09
7.3.70.0080.00414.96
7.3.60.0060.00915.07
7.3.50.0070.00314.97
7.3.40.0030.01314.89
7.3.30.0000.01514.91
7.3.20.0060.00316.96
7.3.10.0070.00416.92
7.3.00.0070.00716.61
7.2.250.0060.01215.36
7.2.240.0090.01215.38
7.2.230.0040.01115.14
7.2.220.0120.00315.25
7.2.210.0000.01915.00
7.2.200.0040.01115.39
7.2.190.0120.00315.36
7.2.180.0040.01115.32
7.2.170.0090.00615.37
7.2.00.0000.01819.83
7.1.330.0120.00315.98
7.1.320.0000.01315.94
7.1.310.0090.00915.98
7.1.300.0030.01015.74
7.1.290.0000.01015.82
7.1.280.0070.00715.75
7.1.270.0100.01016.05
7.1.260.0000.01616.04
7.1.100.0000.01218.24
7.1.70.0040.00417.11
7.1.60.0130.01019.32
7.1.50.0080.01217.11
7.1.00.0000.08022.25
7.0.200.0060.00316.78
7.0.140.0030.07322.18
7.0.90.0000.09021.79
7.0.80.0030.06021.73
7.0.70.0030.04021.75
7.0.60.0070.05721.73
7.0.50.0000.06722.11
7.0.40.0000.06020.04
7.0.30.0070.06720.07
7.0.20.0030.04019.94
7.0.10.0000.06020.04
7.0.00.0030.07020.10
5.6.280.0070.07021.16
5.6.240.0000.08020.71
5.6.230.0070.03720.67
5.6.220.0030.05320.50
5.6.210.0000.04020.48
5.6.200.0070.07721.05
5.6.190.0030.07021.04
5.6.180.0100.03021.09
5.6.170.0000.08020.95
5.6.160.0030.05021.00
5.6.150.0000.07321.04
5.6.140.0070.04321.03
5.6.130.0030.07321.07
5.6.120.0000.08721.02
5.6.110.0070.04321.05
5.6.100.0000.04321.07
5.6.90.0030.04720.95
5.6.80.0000.05720.35
5.6.70.0000.08720.41
5.6.60.0030.03720.42
5.6.50.0030.03720.50
5.6.40.0070.03320.50
5.6.30.0030.05720.39
5.6.20.0000.07020.47
5.6.10.0000.06720.45
5.6.00.0070.06720.45
5.5.380.0030.08020.38
5.5.370.0030.04020.36
5.5.360.0030.04320.57
5.5.350.0030.06720.48
5.5.340.0070.06020.84
5.5.330.0030.04320.79
5.5.320.0030.04320.75
5.5.310.0030.07720.93
5.5.300.0030.08020.90
5.5.290.0000.06320.82
5.5.280.0000.07320.76
5.5.270.0030.04020.76
5.5.260.0030.08020.93
5.5.250.0030.06020.71
5.5.240.0070.07320.04
5.5.230.0100.07720.13
5.5.220.0000.03720.20
5.5.210.0070.03320.16
5.5.200.0030.03320.13
5.5.190.0000.06320.09
5.5.180.0070.05320.22
5.5.160.0000.05720.24
5.5.150.0030.07720.22
5.5.140.0000.08320.16
5.5.130.0170.06720.18
5.5.120.0030.03720.27
5.5.110.0000.08720.24
5.5.100.0030.04020.18
5.5.90.0000.07020.05
5.5.80.0030.07720.07
5.5.70.0030.03720.13
5.5.60.0000.06020.10
5.5.50.0030.07720.10
5.5.40.0000.08019.93
5.5.30.0030.07720.06
5.5.20.0030.07720.03
5.5.10.0000.06020.05
5.5.00.0070.03319.96
5.4.450.0030.03719.27
5.4.440.0070.06719.18
5.4.430.0030.05719.44
5.4.420.0000.07319.36
5.4.410.0030.05319.24
5.4.400.0030.05018.86
5.4.390.0000.08318.85
5.4.380.0030.07319.18
5.4.370.0030.06719.20
5.4.360.0030.06019.12
5.4.350.0000.08019.23
5.4.340.0000.08718.95
5.4.320.0100.07018.84
5.4.310.0000.07318.85
5.4.300.0030.07718.94
5.4.290.0000.08318.88
5.4.280.0000.07719.18
5.4.270.0000.06719.04
5.4.260.0030.07319.04
5.4.250.0000.07718.84
5.4.240.0070.07018.90
5.4.230.0000.07719.13
5.4.220.0100.06319.04
5.4.210.0030.03719.05
5.4.200.0030.07319.04
5.4.190.0000.03719.08
5.4.180.0070.07018.86
5.4.170.0070.06719.15
5.4.160.0000.03719.18
5.4.150.0070.05319.01
5.4.140.0030.06716.47
5.4.130.0000.07016.26
5.4.120.0000.07716.37
5.4.110.0070.06016.44
5.4.100.0000.07316.55
5.4.90.0030.06716.39
5.4.80.0000.03316.55
5.4.70.0000.06016.54
5.4.60.0030.05016.44
5.4.50.0000.07716.45
5.4.40.0130.06016.55
5.4.30.0030.05316.48
5.4.20.0000.06716.36
5.4.10.0030.06716.36
5.4.00.0030.07315.90
5.3.290.0070.07014.61
5.3.280.0030.05714.71
5.3.270.0000.04014.60
5.3.260.0030.03714.75
5.3.250.0000.03714.69
5.3.240.0030.08014.62
5.3.230.0000.06314.60
5.3.220.0070.07314.64
5.3.210.0070.06014.60
5.3.200.0030.07714.64
5.3.190.0030.07714.59
5.3.180.0130.06014.66
5.3.170.0030.06714.64
5.3.160.0070.07314.58
5.3.150.0000.06714.56
5.3.140.0030.06314.61
5.3.130.0030.06714.49
5.3.120.0070.06014.61
5.3.110.0030.07714.69
5.3.100.0070.05714.11
5.3.90.0070.06714.11
5.3.80.0070.05014.11
5.3.70.0030.07314.13
5.3.60.0030.07314.13
5.3.50.0070.02714.11
5.3.40.0000.03314.11
5.3.30.0030.04714.11
5.3.20.0030.07014.11
5.3.10.0030.06314.11
5.3.00.0000.07714.11
5.2.170.0030.05014.11
5.2.160.0030.06014.11
5.2.150.0030.05314.11
5.2.140.0030.06014.11
5.2.130.0000.06314.11
5.2.120.0070.04714.11
5.2.110.0030.05314.11
5.2.100.0030.05714.11
5.2.90.0000.05714.11
5.2.80.0000.05314.11
5.2.70.0030.06014.11
5.2.60.0000.03314.11
5.2.50.0000.05714.11
5.2.40.0000.04014.11
5.2.30.0000.03714.11
5.2.20.0030.02714.11
5.2.10.0000.04014.11
5.2.00.0070.06014.11
5.1.60.0030.02014.11
5.1.50.0030.02014.11
5.1.40.0000.05714.11
5.1.30.0030.02014.11
5.1.20.0000.04714.11
5.1.10.0000.05314.11
5.1.00.0000.05714.11
5.0.50.0030.04314.11
5.0.40.0000.03714.11
5.0.30.0000.02714.11
5.0.20.0000.02014.11
5.0.10.0000.04314.11
5.0.00.0030.05014.11
4.4.90.0000.02014.11
4.4.80.0030.03314.11
4.4.70.0000.03014.11
4.4.60.0030.01714.11
4.4.50.0030.02014.11
4.4.40.0030.02014.11
4.4.30.0000.03714.11
4.4.20.0000.03714.11
4.4.10.0000.03314.11
4.4.00.0000.05014.11
4.3.110.0000.01314.11
4.3.100.0030.02314.11
4.3.90.0000.02714.11
4.3.80.0000.04314.11
4.3.70.0000.01314.11
4.3.60.0000.02314.11
4.3.50.0000.03014.11
4.3.40.0000.05014.11
4.3.30.0030.03014.11
4.3.20.0030.03314.11
4.3.10.0030.03014.11
4.3.00.0000.03314.11

preferences:
41.29 ms | 401 KiB | 5 Q