3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = function ($instance) { return $instance->x; }; class FooBar { public $x = 3; } $foobar = new FooBar; for ($i = 0; $i < 100000; $i++) { $x = function () use ($foobar, $a) [ return $a($foobar); }; $x(); }

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.310.4530.04319.15
5.4.300.4470.03719.13
5.4.290.4400.03718.98
5.4.280.3770.03319.13
5.4.270.5200.03019.06
5.4.260.4030.03719.24
5.4.250.4170.03718.98
5.4.240.4270.03718.94
5.4.230.4670.03719.21
5.4.220.4200.03318.93
5.4.210.3730.04318.98
5.4.200.3800.03319.15
5.4.190.4170.04019.18
5.4.180.4430.05019.12
5.4.170.4400.03718.94
5.4.160.3830.03318.91
5.4.150.4830.04019.13
5.4.140.4470.03016.55
5.4.130.3670.03716.54
5.4.120.3930.03316.54
5.4.110.3700.04016.69
5.4.100.3830.03316.63
5.4.90.3870.03016.61
5.4.80.4000.03716.41
5.4.70.0030.07316.52
5.4.60.0100.03716.33
5.4.50.4370.03316.49
5.4.40.4570.04016.42
5.4.30.4470.04016.49
5.4.20.3770.03716.54
5.4.10.4070.03716.41
5.4.00.3800.03715.85
5.3.280.3830.04014.64
5.3.270.4300.03714.50
5.3.260.4330.04314.68
5.3.250.4370.04014.62
5.3.240.4530.03714.61
5.3.230.4300.04014.52
5.3.220.3270.04014.60
5.3.210.2930.04014.57
5.3.200.3530.04014.49
5.3.190.4300.03714.64
5.3.180.3800.03314.45
5.3.170.2600.05014.57
5.3.160.0000.06014.73
5.3.150.3700.03314.59
5.3.140.4630.03714.62
5.3.130.4100.03714.70
5.3.120.3870.03714.58
5.3.110.3700.03014.58
5.3.100.3900.02714.07
5.3.90.3930.03314.08
5.3.80.4130.03314.10
5.3.70.4200.04314.18
5.3.60.3330.03314.16
5.3.50.1230.02713.98
5.3.40.3470.03313.95
5.3.30.0070.03713.83
5.3.20.0000.03713.70
5.3.10.3600.02713.65
5.3.00.3230.03313.80
5.2.170.0800.02311.08
5.2.160.2200.02711.23
5.2.150.1570.03011.08
5.2.140.0000.03011.22
5.2.130.0100.02011.08
5.2.120.1230.02711.01
5.2.110.3070.03011.04
5.2.100.3530.03311.04
5.2.90.2300.03311.09
5.2.80.2070.03010.97
5.2.70.2700.02710.95
5.2.60.2130.03010.94
5.2.50.2370.02710.94
5.2.40.1730.03010.84
5.2.30.2070.03010.97
5.2.20.2070.03010.95
5.2.10.2100.02710.76
5.2.00.2230.03010.71
5.1.60.2130.0179.99
5.1.50.2770.0209.94
5.1.40.2530.02310.14
5.1.30.3370.02710.34
5.1.20.2800.03010.35
5.1.10.2700.02010.12
5.1.00.2900.02710.11
5.0.50.1230.0238.52
5.0.40.1530.0208.36
5.0.30.1630.0308.21
5.0.20.1870.0208.16
5.0.10.1570.0178.21
5.0.00.1870.0338.10
4.4.90.0570.0105.85
4.4.80.0670.0135.88
4.4.70.1000.0135.80
4.4.60.0800.0135.80
4.4.50.0430.0135.81
4.4.40.1230.0235.81
4.4.30.1770.0175.84
4.4.20.1600.0175.87
4.4.10.1770.0135.83
4.4.00.2070.0205.85
4.3.110.1830.0235.77
4.3.100.1930.0135.73
4.3.90.1500.0105.70
4.3.80.1670.0235.77
4.3.70.1870.0175.67
4.3.60.1870.0135.80
4.3.50.1870.0175.67
4.3.40.1400.0235.63
4.3.30.0800.0205.19
4.3.20.1130.0205.19
4.3.10.0870.0135.19
4.3.00.0770.0175.19

preferences:
140.52 ms | 1394 KiB | 7 Q