3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo {} function bar() { static $i = 0; return ++$i; } function &refBar() { static $j = 0; $j++; return $j; } new Foo(bar()); new Foo(refBar()); $sprintf = sprintf("Sprintf: %d", bar()++); $sprintf = sprintf("Sprintf: %d", refBar()++); echo "Did call bar " . bar() . " times\n"; echo "Did call refBar " . refBar() . " times\n";

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)
5.4.350.3870.04019.15
5.4.340.3770.04019.23
5.4.320.3900.03318.99
5.4.310.3600.03719.18
5.4.300.4000.03319.17
5.4.290.3930.03019.13
5.4.280.3930.04318.95
5.4.270.3730.03319.19
5.4.260.4630.03719.13
5.4.250.4570.03319.05
5.4.240.4530.03719.26
5.4.230.4300.03018.98
5.4.220.4300.03319.13
5.4.210.4430.04019.05
5.4.200.4570.03718.98
5.4.190.4600.03319.25
5.4.180.3970.04319.12
5.4.170.4470.04018.98
5.4.160.4630.04019.15
5.4.150.3530.03719.21
5.4.140.3800.03716.41
5.4.130.3870.03716.44
5.4.120.3870.03316.40
5.4.110.4230.03716.61
5.4.100.4570.03316.53
5.4.90.4430.03316.53
5.4.80.4570.02716.36
5.4.70.4470.03716.48
5.4.60.4030.03316.45
5.4.50.3870.03016.33
5.4.40.3500.04016.61
5.4.30.4100.03716.52
5.4.20.3830.03316.48
5.4.10.4830.03716.50
5.4.00.3970.03715.96
5.3.290.3400.03714.67
5.3.280.4270.03314.61
5.3.270.4270.03714.68
5.3.260.4030.04014.64
5.3.250.3600.03314.75
5.3.240.3770.03714.60
5.3.230.3630.04014.61
5.3.220.5600.03014.60
5.3.210.4270.04314.57
5.3.200.4400.03714.61
5.3.190.4500.04314.73
5.3.180.4200.04014.62
5.3.170.4400.03714.55
5.3.160.4070.03314.55
5.3.150.4130.04714.61
5.3.140.3800.04014.59
5.3.130.4100.04014.46
5.3.120.4000.04714.71
5.3.110.4200.03714.55
5.3.100.4070.03714.11
5.3.90.4030.02714.04
5.3.80.3970.04013.97
5.3.70.0100.03714.07
5.3.60.0100.07014.07
5.3.50.0070.07313.99
5.3.40.4600.03313.96
5.3.30.4000.03013.83
5.3.20.3630.03313.86
5.3.10.4370.04313.82
5.3.00.3670.03713.80
5.2.170.1170.04711.12
5.2.160.3530.03011.31
5.2.150.3600.02711.21
5.2.140.3000.02311.10
5.2.130.3530.03011.27
5.2.120.3930.03011.08
5.2.110.3730.02711.16
5.2.100.2670.03311.10
5.2.90.2830.02311.10
5.2.80.2730.03011.15
5.2.70.3170.02711.13
5.2.60.2630.02711.11
5.2.50.3000.03011.01
5.2.40.2370.02711.18
5.2.30.2430.02711.12
5.2.20.2270.02711.02
5.2.10.0030.02711.01
5.2.00.0030.02710.79
5.1.60.0030.0279.98
5.1.50.0000.02310.02
5.1.40.1500.0239.98
5.1.30.2370.02710.31
5.1.20.2370.03010.32
5.1.10.2470.0179.99
5.1.00.3000.0339.99
5.0.50.1170.0208.52
5.0.40.1200.0178.46
5.0.30.1530.0338.29
5.0.20.1730.0238.25
5.0.10.1630.0208.15
5.0.00.1570.0378.18
4.4.90.1200.0135.80
4.4.80.1000.0135.93
4.4.70.1200.0135.88
4.4.60.1170.0175.79
4.4.50.0630.0175.82
4.4.40.0000.0235.89
4.4.30.0000.0175.79
4.4.20.1300.0175.94
4.4.10.1200.0135.93
4.4.00.1470.0275.88
4.3.110.1170.0135.80
4.3.100.1700.0175.79
4.3.90.1500.0175.77
4.3.80.1900.0275.78
4.3.70.1670.0135.77
4.3.60.1430.0135.77
4.3.50.1600.0205.79
4.3.40.1470.0205.77
4.3.30.0770.0135.77
4.3.20.0870.0105.77
4.3.10.0800.0175.77
4.3.00.0800.0175.77

preferences:
140.27 ms | 1394 KiB | 7 Q