3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Bar { } class Foo { private $bar; public function __construct(Bar $bar) { $this->bar = $bar; } } $bar = new Bar; $t1 = microtime(true); for ($i = 0; $i < 10000; $i++) { $reflect = new ReflectionClass('foo'); $constructor = $reflect->getConstructor(); } $t2 = microtime(true); echo 'getcons ' . ($t2-$t1) . '<br />'; $t1 = microtime(true); for ($i = 0; $i < 10000; $i++) { $constructor = method_exists('Foo', '__construct') ? new ReflectionMethod('Foo', '__construct') : null; } $t2 = microtime(true); echo 'rm: ' . ($t2-$t1) . '<br />';

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.4.00.0030.02315.03
7.3.120.0110.01814.61
7.3.110.0070.01714.80
7.3.100.0060.01614.92
7.3.90.0030.01714.57
7.3.80.0030.01614.93
7.3.70.0030.02014.89
7.3.60.0060.01314.87
7.3.50.0040.01514.72
7.3.40.0000.02414.91
7.3.30.0030.01414.86
7.3.20.0120.00916.75
7.3.10.0030.01716.60
7.3.00.0040.01516.47
7.2.250.0060.02615.00
7.2.240.0000.03515.16
7.2.230.0030.02415.05
7.2.220.0040.01914.91
7.2.210.0000.02715.21
7.2.200.0040.02114.97
7.2.190.0130.01315.13
7.2.180.0040.01914.88
7.2.170.0030.02214.89
7.2.130.0100.02316.75
7.2.120.0080.02116.81
7.2.110.0200.01316.86
7.2.100.0190.01016.55
7.2.90.0070.01516.99
7.2.80.0070.02316.84
7.2.70.0090.02816.64
7.2.60.0120.02116.83
7.2.50.0170.02116.97
7.2.40.0110.03216.74
7.2.30.0100.01717.05
7.2.20.0100.02016.91
7.2.10.0100.01316.88
7.2.00.0060.01917.98
7.1.330.0100.01915.82
7.1.320.0070.02015.92
7.1.310.0030.02815.74
7.1.300.0030.02115.83
7.1.290.0060.02315.82
7.1.280.0030.02415.55
7.1.270.0000.02515.68
7.1.260.0040.02215.78
7.1.250.0100.02015.66
7.1.70.0030.01717.26
7.1.60.0070.03419.40
7.1.50.0040.01816.71
7.1.00.0070.08722.54
7.0.200.0120.01614.85
7.0.140.0000.08721.92
7.0.60.0300.08719.86
7.0.50.0170.03717.86
7.0.40.0070.09020.18
7.0.30.0600.05320.30
7.0.20.0170.06020.24
7.0.10.0370.05720.30
7.0.00.0130.06320.24
5.6.280.0100.09020.92
5.6.210.0030.07320.65
5.6.200.0100.10018.23
5.6.190.0100.06720.68
5.6.180.4200.05020.67
5.6.170.0270.05020.46
5.6.160.0030.06020.50
5.6.150.0070.10318.16
5.6.140.0130.09318.19
5.6.130.0070.05718.18
5.6.120.0070.07721.13
5.6.110.0130.10320.98
5.6.100.0070.07721.11
5.6.90.0070.09320.98
5.6.80.0070.11020.41
5.5.350.0200.07320.45
5.5.340.0100.08317.95
5.5.330.0030.08320.38
5.5.320.0770.04720.26
5.5.310.0200.06020.28
5.5.300.0030.07017.98
5.5.290.0130.07718.04
5.5.280.0100.06020.88
5.5.270.0030.06020.77
5.5.260.0170.08320.63
5.5.250.0000.05720.67
5.5.240.0370.08320.19
5.4.450.0900.07719.16
5.4.440.0170.08019.67
5.4.430.1070.08319.28
5.4.420.0730.09019.68
5.4.410.0570.06719.54
5.4.400.0800.09719.08
5.4.390.0630.07718.90
5.4.380.0170.07318.59
5.4.370.0200.05718.73
5.4.360.0100.07718.52
5.4.350.0090.05912.02
5.4.340.0120.11012.02
5.4.320.0050.05412.50
5.4.310.0040.05912.49
5.4.300.0040.05312.50
5.4.290.0070.05312.50
5.4.280.0100.05312.39
5.4.270.0070.05412.39
5.4.260.0060.05612.39
5.4.250.0080.05412.39
5.4.240.0050.05512.39
5.4.230.0070.05412.39
5.4.220.0060.05712.39
5.4.210.0040.05312.39
5.4.200.0070.06212.38
5.4.190.0060.05412.38
5.4.180.0060.05412.39
5.4.170.0080.05212.39
5.4.160.0080.05112.39
5.4.150.0090.06812.39
5.4.140.0070.05812.07
5.4.130.0090.04712.05
5.4.120.0080.05112.02
5.4.110.0040.05412.02
5.4.100.0080.05112.01
5.4.90.0060.05412.01
5.4.80.0040.05612.02
5.4.70.0040.06212.01
5.4.60.0030.05312.00
5.4.50.0070.06112.01
5.4.40.0030.05612.00
5.4.30.0060.05311.99
5.4.20.0040.05511.99
5.4.10.0060.05111.99
5.4.00.0090.05611.48
5.3.290.0070.06112.80
5.3.280.0060.05612.71
5.3.270.0060.05812.72
5.3.260.0040.06112.72
5.3.250.0060.05812.72
5.3.240.0030.06112.72
5.3.230.0070.05712.71
5.3.220.0040.05912.68
5.3.210.0090.05712.68
5.3.200.0050.06012.68
5.3.190.0050.06012.67
5.3.180.0020.06212.67
5.3.170.0030.06012.67
5.3.160.0040.06112.67
5.3.150.0050.05912.68
5.3.140.0050.05912.66
5.3.130.0060.05812.66
5.3.120.0040.06012.66
5.3.110.0050.05812.66
5.3.100.0070.05612.12
5.3.90.0050.05812.11
5.3.80.0060.05512.09
5.3.70.0060.05512.09
5.3.60.0050.05612.08
5.3.50.0060.05712.03
5.3.40.0070.05612.03
5.3.30.0050.05311.99
5.3.20.0050.05511.77
5.3.10.0060.05111.73
5.3.00.0050.05611.72
5.2.170.0040.0489.22
5.2.160.0050.0489.22
5.2.150.0020.0519.23
5.2.140.0070.0479.22
5.2.130.0050.0489.18
5.2.120.0030.0509.18
5.2.110.0040.0499.19
5.2.100.0050.0479.19
5.2.90.0050.0489.18
5.2.80.0060.0499.18
5.2.70.0080.0469.18
5.2.60.0070.0469.13
5.2.50.0030.0509.10
5.2.40.0040.0469.07
5.2.30.0020.0499.06
5.2.20.0070.0439.04
5.2.10.0050.0468.96
5.2.00.0110.0428.83
5.1.60.0050.0418.11
5.1.50.0040.0578.10
5.1.40.0030.0448.09
5.1.30.0080.0538.44
5.1.20.0020.0478.47
5.1.10.0030.0448.20
5.1.00.0040.0428.19
5.0.50.0030.0366.68
5.0.40.0040.0346.53
5.0.30.0060.0476.35
5.0.20.0030.0346.32
5.0.10.0030.0336.29
5.0.00.0020.0466.29
4.4.90.0040.0144.77
4.4.80.0020.0164.76
4.4.70.0040.0144.75
4.4.60.0030.0154.75
4.4.50.0020.0164.77
4.4.40.0040.0244.71
4.4.30.0060.0124.75
4.4.20.0030.0154.85
4.4.10.0030.0154.84
4.4.00.0040.0234.75
4.3.110.0020.0164.67
4.3.100.0020.0154.66
4.3.90.0030.0144.64
4.3.80.0030.0244.58
4.3.70.0040.0134.63
4.3.60.0010.0164.63
4.3.50.0020.0164.63
4.3.40.0020.0244.54
4.3.30.0040.0143.30
4.3.20.0010.0173.28
4.3.10.0020.0153.24
4.3.00.0170.0207.08

preferences:
33.89 ms | 401 KiB | 5 Q