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)
7.3.120.0000.02614.67
7.3.110.0070.02014.62
7.3.100.0030.01714.92
7.3.90.0090.01514.93
7.3.80.0030.01614.69
7.3.70.0090.00914.58
7.3.60.0060.01614.46
7.3.50.0030.01714.73
7.3.40.0030.01914.64
7.3.30.0130.00714.82
7.3.20.0070.01316.35
7.3.10.0040.01816.43
7.3.00.0040.01816.55
7.2.240.0070.02415.05
7.2.230.0070.02115.15
7.2.220.0100.01615.14
7.2.210.0070.02014.94
7.2.200.0110.01415.07
7.2.190.0120.01515.10
7.2.180.0030.02114.67
7.2.170.0030.02115.18
7.2.160.0070.01715.11
7.2.150.0030.02217.11
7.2.140.0060.02217.00
7.2.130.0060.01617.08
7.2.120.0040.01816.83
7.2.110.0060.01817.04
7.2.100.0040.02216.55
7.2.90.0000.02816.97
7.2.80.0100.01716.98
7.2.70.0030.02416.85
7.2.60.0060.01817.14
7.2.50.0070.02016.65
7.2.40.0100.01616.89
7.2.30.0140.01417.15
7.2.20.0060.01817.05
7.2.10.0120.01216.93
7.2.00.0030.02018.09
7.1.330.0060.02315.76
7.1.320.0100.01915.61
7.1.310.0040.02115.80
7.1.300.0060.01915.75
7.1.290.0030.02715.82
7.1.280.0030.02315.70
7.1.270.0000.02715.79
7.1.260.0000.03015.48
7.1.250.0000.02515.77
7.1.70.0070.00717.27
7.1.60.0160.01919.40
7.1.50.0140.02416.78
7.1.00.0100.08322.48
7.0.200.0210.01215.05
7.0.140.0070.08022.00
7.0.60.0070.06020.05
7.0.50.0130.08317.86
7.0.40.0070.06019.98
7.0.30.0330.04020.24
7.0.20.0300.08320.12
7.0.10.0100.09320.22
7.0.00.0070.04720.24
5.6.280.0070.09020.86
5.6.210.0030.07720.55
5.6.200.0100.04718.17
5.6.190.0030.05720.61
5.6.180.0300.09020.54
5.6.170.0100.05720.71
5.6.160.0100.10020.57
5.6.150.0070.04718.15
5.6.140.0100.08018.13
5.6.130.0000.05718.17
5.6.120.0100.10020.96
5.6.110.0070.10320.98
5.6.100.0130.09021.02
5.6.90.0030.07320.88
5.6.80.0100.06020.41
5.5.350.0030.08720.43
5.5.340.0000.06017.99
5.5.330.0170.05720.42
5.5.320.0070.10020.27
5.5.310.0100.06320.32
5.5.300.0030.10317.95
5.5.290.0130.08317.98
5.5.280.0070.09320.69
5.5.270.0000.07320.96
5.5.260.0130.06320.67
5.5.250.0100.09320.61
5.5.240.3670.04320.29
5.4.450.0100.06719.46
5.4.440.0130.06319.27
5.4.430.0200.05319.54
5.4.420.0230.05719.51
5.4.410.0270.04719.33
5.4.400.0100.06318.84
5.4.390.0270.05719.11
5.4.380.0230.06718.68
5.4.370.0100.07318.62
5.4.360.0200.06318.50
5.4.350.0100.08318.65
5.4.340.0170.06318.75
5.4.320.0050.05012.50
5.4.310.0080.04912.50
5.4.300.0070.05212.50
5.4.290.0060.05612.50
5.4.280.0050.05212.40
5.4.270.0070.05212.39
5.4.260.0090.05412.39
5.4.250.0080.05712.39
5.4.240.0030.05512.39
5.4.230.0050.05312.38
5.4.220.0020.05512.38
5.4.210.0040.05112.38
5.4.200.0070.05112.38
5.4.190.0050.05312.38
5.4.180.0030.06112.38
5.4.170.0010.05512.39
5.4.160.0070.05612.39
5.4.150.0100.05212.39
5.4.140.0110.05512.07
5.4.130.0070.05112.06
5.4.120.0050.05412.02
5.4.110.0090.04712.01
5.4.100.0050.04912.02
5.4.90.0050.05712.02
5.4.80.0070.05512.01
5.4.70.0030.05112.01
5.4.60.0080.05012.01
5.4.50.0070.04812.00
5.4.40.0050.05411.99
5.4.30.0070.05111.99
5.4.20.0070.04812.00
5.4.10.0060.05211.99
5.4.00.0050.05111.49
5.3.290.0030.06112.80
5.3.280.0070.05612.71
5.3.270.0090.06112.72
5.3.260.0030.06012.72
5.3.250.0090.05312.72
5.3.240.0040.05812.72
5.3.230.0060.06112.71
5.3.220.0160.06212.68
5.3.210.0030.05912.68
5.3.200.0050.05812.68
5.3.190.0060.05712.68
5.3.180.0050.06312.68
5.3.170.0060.06212.67
5.3.160.0050.05612.68
5.3.150.0080.05912.67
5.3.140.0070.05912.66
5.3.130.0080.05912.66
5.3.120.0070.05912.66
5.3.110.0040.05912.65
5.3.100.0070.05712.12
5.3.90.0050.05712.10
5.3.80.0050.06212.10
5.3.70.0040.05512.09
5.3.60.0050.05412.08
5.3.50.0040.05712.03
5.3.40.0060.05812.03
5.3.30.0090.05411.99
5.3.20.0060.05411.76
5.3.10.0050.05511.73
5.3.00.0080.05411.72
5.2.170.0070.0309.22
5.2.160.0070.0269.23
5.2.150.0050.0299.22
5.2.140.0050.0299.22
5.2.130.0070.0329.18
5.2.120.0070.0289.18
5.2.110.0030.0309.18
5.2.100.0040.0289.18
5.2.90.0050.0279.18
5.2.80.0070.0279.18
5.2.70.0060.0289.18
5.2.60.0040.0309.13
5.2.50.0030.0329.10
5.2.40.0040.0309.07
5.2.30.0040.0329.05
5.2.20.0050.0279.04
5.2.10.0030.0378.95
5.2.00.0030.0308.81
5.1.60.0030.0248.09
5.1.50.0030.0258.09
5.1.40.0090.0228.07
5.1.30.0090.0258.42
5.1.20.0050.0248.45
5.1.10.0060.0248.17
5.1.00.0020.0278.17
5.0.50.0030.0246.66
5.0.40.0040.0216.51
5.0.30.0030.0326.33
5.0.20.0050.0176.30
5.0.10.0020.0216.27
5.0.00.0030.0306.27
4.4.90.0040.0214.78
4.4.80.0030.0184.75
4.4.70.0010.0164.76
4.4.60.0000.0174.75
4.4.50.0010.0164.77
4.4.40.0030.0244.70
4.4.30.0040.0134.76
4.4.20.0050.0184.84
4.4.10.0050.0134.84
4.4.00.0020.0254.76
4.3.110.0020.0154.67
4.3.100.0020.0204.66
4.3.90.0040.0164.64
4.3.80.0010.0364.59
4.3.70.0000.0194.63
4.3.60.0030.0144.63
4.3.50.0040.0204.63
4.3.40.0010.0254.54
4.3.30.0030.0223.30
4.3.20.0040.0183.28
4.3.10.0020.0203.23
4.3.00.0130.01715.98

preferences:
58.14 ms | 401 KiB | 5 Q