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 "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.2.60.0120.00816.82
7.2.50.0180.00916.55
7.1.200.0070.00715.99
7.1.70.0090.00617.42
7.1.60.0110.01419.32
7.1.50.0060.00617.17
7.1.00.0130.06322.29
7.0.200.0080.00016.88
7.0.140.0000.07722.09
7.0.80.0100.04319.96
7.0.70.0100.08019.90
7.0.60.0200.05720.02
7.0.50.0530.08720.36
7.0.40.0100.04720.10
7.0.30.0070.05320.04
7.0.20.0100.05719.95
7.0.10.0070.07020.05
7.0.00.0130.07020.04
5.6.280.0130.06321.11
5.6.230.0030.07320.70
5.6.220.0070.08020.52
5.6.210.0070.06020.65
5.6.200.0200.07021.06
5.6.190.0130.07720.96
5.6.180.0070.06321.12
5.6.170.0100.06720.96
5.6.160.0170.06720.95
5.6.150.0070.08721.07
5.6.140.0130.07321.09
5.6.130.0130.08020.96
5.6.120.0070.06721.03
5.6.110.0100.08021.02
5.6.100.0100.08021.00
5.6.90.0100.04320.92
5.6.80.0000.05320.43
5.6.70.0100.04720.44
5.6.60.0070.07320.48
5.6.50.0070.08020.33
5.6.40.0030.05320.54
5.6.30.0070.06020.32
5.6.20.0070.07720.44
5.6.10.0170.07320.50
5.6.00.0100.04720.36
5.5.370.0070.08320.43
5.5.360.0100.05320.44
5.5.350.0070.07320.38
5.5.340.0030.04720.82
5.5.330.0100.06720.90
5.5.320.0200.06020.91
5.5.310.0030.04720.89
5.5.300.0030.08320.95
5.5.290.0200.07720.84
5.5.280.0130.08020.77
5.5.270.0070.05020.73
5.5.260.0000.08720.91
5.5.250.0030.05020.46
5.5.240.0100.05320.27
5.5.230.0070.07720.29
5.5.220.0170.07320.21
5.5.210.0100.06320.25
5.5.200.0030.04320.27
5.5.190.0070.07020.30
5.5.180.0030.06020.22
5.5.160.0100.07020.25
5.5.150.0170.07020.28
5.5.140.0030.08320.19
5.5.130.0130.07020.24
5.5.120.0200.05720.12
5.5.110.0070.04720.15
5.5.100.0170.03720.11
5.5.90.0100.07020.14
5.5.80.0000.05720.17
5.5.70.0030.08320.13
5.5.60.0070.07720.10
5.5.50.0000.06320.07
5.5.40.0070.07019.97
5.5.30.0070.05020.11
5.5.20.0130.05320.04
5.5.10.0130.07320.10
5.5.00.0130.05320.11
5.4.450.0100.05719.20
5.4.440.0030.04319.46
5.4.430.0070.08019.41
5.4.420.0130.07019.16
5.4.410.0030.04019.43
5.4.400.0000.04319.13
5.4.390.0030.07718.95
5.4.380.0100.07019.04
5.4.370.0030.08019.05
5.4.360.0200.07018.88
5.4.350.0200.05718.89
5.4.340.0100.06019.04
5.4.320.0070.07319.05
5.4.310.0030.07019.16
5.4.300.0070.05019.04
5.4.290.0000.08319.18
5.4.280.0070.08019.12
5.4.270.0100.07319.15
5.4.260.0030.04719.09
5.4.250.0030.08019.22
5.4.240.0070.04018.89
5.4.230.0100.06719.04
5.4.220.0130.06718.94
5.4.210.0070.08019.11
5.4.200.0100.05719.17
5.4.190.0170.07019.20
5.4.180.0100.07719.11
5.4.170.0030.08019.02
5.4.160.0170.06019.01
5.4.150.0070.05019.03
5.4.140.0070.07316.45
5.4.130.0030.07316.55
5.4.120.0100.07016.53
5.4.110.0100.07316.52
5.4.100.0100.07316.34
5.4.90.0070.06716.45
5.4.80.0070.07316.52
5.4.70.0030.07716.47
5.4.60.0100.04316.41
5.4.50.0030.04316.31
5.4.40.0000.04016.42
5.4.30.0070.03316.26
5.4.20.0000.04016.38
5.4.10.0100.07316.33
5.4.00.0170.06015.85
5.3.290.0100.07714.83
5.3.280.0070.04714.67
5.3.270.0130.06714.68
5.3.260.0030.08014.58
5.3.250.0000.08014.71
5.3.240.0130.07314.74
5.3.230.0070.07714.56
5.3.220.0000.08014.70
5.3.210.0030.06714.58
5.3.200.0100.07314.64
5.3.190.0000.08014.61
5.3.180.0030.05014.54
5.3.170.0130.06714.64
5.3.160.0070.03714.63
5.3.150.0030.04014.64
5.3.140.0070.04014.60
5.3.130.0070.06714.56
5.3.120.0100.03314.52
5.3.110.0000.04314.58
5.3.100.0070.08014.14
5.3.90.0100.07014.15
5.3.80.0100.07713.96
5.3.70.0070.05714.10
5.3.60.0070.07013.90
5.3.50.0100.06314.10
5.3.40.0130.06713.89
5.3.30.0030.04314.01
5.3.20.0000.03713.75
5.3.10.0000.05013.64
5.3.00.0030.03713.71
5.2.170.0030.03311.19
5.2.160.0030.05311.27
5.2.150.0100.05011.26
5.2.140.0030.03011.21
5.2.130.0030.03011.16
5.2.120.0030.05011.14
5.2.110.0000.03711.25
5.2.100.0000.03011.02
5.2.90.0000.03011.17
5.2.80.0000.03711.14
5.2.70.0070.02311.05
5.2.60.0030.03010.92
5.2.50.0000.03011.09
5.2.40.0000.03011.03
5.2.30.0000.03010.99
5.2.20.0170.01311.06
5.2.10.0000.03010.79
5.2.00.0030.02710.76
5.1.60.0030.02310.04
5.1.50.0030.02710.09
5.1.40.0000.0279.83
5.1.30.0000.02710.34
5.1.20.0000.04310.39
5.1.10.0000.0239.92
5.1.00.0070.02710.15
5.0.50.0070.0138.66
5.0.40.0070.0408.53
5.0.30.0030.0378.24
5.0.20.0000.0208.30
5.0.10.0000.0378.18
5.0.00.0000.0278.06
4.4.90.0000.0177.63
4.4.80.0030.0137.63
4.4.70.0000.0137.63
4.4.60.0030.0137.63
4.4.50.0000.0177.63
4.4.40.0030.0237.63
4.4.30.0000.0177.63
4.4.20.0030.0177.63
4.4.10.0030.0137.63
4.4.00.0030.0237.63
4.3.110.0000.0177.63
4.3.100.0000.0137.63
4.3.90.0030.0177.63
4.3.80.0000.0307.63
4.3.70.0000.0177.63
4.3.60.0000.0277.63
4.3.50.0000.0207.63
4.3.40.0000.0477.63
4.3.30.0000.0177.63
4.3.20.0000.0137.63
4.3.10.0070.0137.63
4.3.00.0000.0137.63

preferences:
37.95 ms | 400 KiB | 5 Q