3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { protected $bar = 'baz'; public function getBar() { return $this->bar; } } $foo = new Foo; $time = microtime(true); for ($i = 0; $i <= 10000; $i++) { $ref = new ReflectionClass($foo); $property = $ref->getProperty('bar'); $property->setAccessible(true); $property->getValue($foo); } echo "REFLECTION": microtime(true) - $time, PHP_EOL; $time = microtime(true); for ($i = 0; $i <= 10000; $i++) { $foo->getBar(); } echo "GETTER": microtime(true) - $time, PHP_EOL;

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.320.4500.03718.97
5.4.310.0070.03319.00
5.4.300.2770.04319.26
5.4.290.4600.03318.98
5.4.280.4370.03719.09
5.4.270.4930.04719.20
5.4.260.4470.04019.06
5.4.250.4100.04319.13
5.4.240.5130.03319.20
5.4.230.4430.04019.13
5.4.220.3100.03719.21
5.4.210.0100.07019.10
5.4.200.0070.05718.98
5.4.190.3370.04019.21
5.4.180.3830.03019.25
5.4.170.4370.04318.96
5.4.160.4070.04018.95
5.4.150.4500.03719.20
5.4.140.4470.03316.55
5.4.130.4030.03016.49
5.4.120.3970.03316.55
5.4.110.4700.04016.70
5.4.100.4530.03716.44
5.4.90.4100.04016.53
5.4.80.4500.03716.29
5.4.70.4270.03316.52
5.4.60.4670.03316.44
5.4.50.4500.03316.54
5.4.40.3830.03716.29
5.4.30.3970.03716.50
5.4.20.3470.03716.45
5.4.10.3530.04016.52
5.4.00.3430.04015.89
5.3.290.2870.04014.66
5.3.280.3670.03714.63
5.3.270.4170.04014.68
5.3.260.4230.03314.66
5.3.250.4430.04014.61
5.3.240.4070.03314.66
5.3.230.4130.04014.60
5.3.220.4070.03014.63
5.3.210.4030.03014.72
5.3.200.4470.04314.46
5.3.190.4230.03314.60
5.3.180.4470.03714.58
5.3.170.4200.03714.73
5.3.160.4500.04014.62
5.3.150.4530.04014.71
5.3.140.4070.04014.61
5.3.130.3770.04314.58
5.3.120.3330.03014.70
5.3.110.3170.03014.54
5.3.100.4200.03714.05
5.3.90.3470.03314.18
5.3.80.3500.03314.06
5.3.70.3300.03714.07
5.3.60.3170.03314.00
5.3.50.2800.03713.96
5.3.40.3030.03313.95
5.3.30.3500.03313.91
5.3.20.3900.03313.73
5.3.10.3900.03713.71
5.3.00.4270.03713.56
5.2.170.2430.02711.09
5.2.160.2970.03011.16
5.2.150.3100.02711.09
5.2.140.3300.03311.30
5.2.130.3030.03311.16
5.2.120.3500.02311.15
5.2.110.3730.02711.05
5.2.100.3470.02711.15
5.2.90.3800.02311.16
5.2.80.3230.03311.16
5.2.70.3230.02711.13
5.2.60.3670.02711.05
5.2.50.3830.02310.98
5.2.40.3130.03011.04
5.2.30.2770.03011.04
5.2.20.2830.02711.02
5.2.10.3170.02311.02
5.2.00.2600.02710.60
5.1.60.3030.02010.04
5.1.50.2570.02710.04
5.1.40.2930.0279.95
5.1.30.3000.02010.37
5.1.20.2570.02310.36
5.1.10.2830.0279.98
5.1.00.2130.02710.02
5.0.50.1470.0278.52
5.0.40.1670.0208.58
5.0.30.1630.0238.18
5.0.20.1670.0208.17
5.0.10.1570.0208.16
5.0.00.1530.0338.23
4.4.90.1230.0135.89
4.4.80.1570.0175.89
4.4.70.1770.0105.89
4.4.60.1470.0135.89
4.4.50.1470.0175.89
4.4.40.1500.0305.89
4.4.30.1230.0135.89
4.4.20.1430.0175.95
4.4.10.1530.0135.91
4.4.00.1800.0235.89
4.3.110.1730.0175.89
4.3.100.1400.0135.89
4.3.90.1600.0135.89
4.3.80.0930.0275.89
4.3.70.1400.0175.89
4.3.60.1530.0175.89
4.3.50.1670.0135.89
4.3.40.1430.0235.89
4.3.30.0770.0205.89
4.3.20.0900.0175.89
4.3.10.0630.0175.89
4.3.00.0600.0175.89

preferences:
158.54 ms | 1394 KiB | 7 Q