3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; public function setBar($bar) { $this->bar = $bar; } public function getBar() { return $this->bar; } } $n = 10000; $t = microtime(true); $foo = new Foo(); for ($i = 0; $i < $n; $i++) { $foo->setBar("foo"); $foo->getBar(); } echo number_format(microtime(true) - $t, 6) . "\n"; $t = microtime(true); $reflClass = new ReflectionClass('Foo'); $property = $reflClass->getProperty('bar'); $property->setAccessible(true); $foo = new Foo(); for ($i = 0; $i < $n; $i++) { $property->setValue($foo, "bar"); $property->getValue($foo); } echo number_format(microtime(true) - $t, 6) . "\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)
7.4.10.0070.01315.09
7.4.00.0070.01414.86
7.3.130.0070.01714.79
7.3.120.0100.01314.50
7.3.110.0130.01014.98
7.3.100.0000.01914.84
7.3.90.0100.01015.16
7.3.80.0100.01014.78
7.3.70.0000.02014.68
7.3.60.0040.01414.71
7.3.50.0000.01214.79
7.3.40.0110.01114.93
7.3.30.0120.00614.80
7.3.20.0000.01716.45
7.3.10.0080.00916.44
7.3.00.0080.01116.57
7.2.260.0130.01315.08
7.2.250.0030.02115.21
7.2.240.0060.01215.12
7.2.230.0110.01115.11
7.2.220.0090.00615.05
7.2.210.0030.01615.23
7.2.200.0030.01415.15
7.2.190.0100.01015.15
7.2.180.0070.01414.80
7.2.170.0100.01015.04
7.2.160.0000.02214.91
7.2.150.0030.01417.04
7.2.140.0030.02017.09
7.2.130.0080.01317.00
7.2.120.0090.01216.84
7.2.110.0030.01616.79
7.2.100.0070.01516.60
7.2.90.0100.01416.89
7.2.80.0080.01216.88
7.2.70.0100.01216.62
7.2.60.0100.01416.59
7.2.50.0080.01116.84
7.2.40.0110.01316.98
7.2.30.0100.01216.84
7.2.20.0120.01316.86
7.2.10.0040.01916.98
7.2.00.0090.01217.70
7.1.330.0040.01415.74
7.1.320.0030.01615.63
7.1.310.0030.01715.54
7.1.300.0030.01715.80
7.1.290.0030.01615.83
7.1.280.0060.01615.89
7.1.270.0070.01415.79
7.1.260.0080.01515.86
7.1.250.0120.01515.75
7.1.240.0120.00915.89
7.1.230.0060.01615.92
7.1.220.0030.01615.83
7.1.210.0090.01615.56
7.1.200.0060.01315.75
7.1.190.0160.00615.90
7.1.180.0030.01915.86
7.1.170.0030.01515.60
7.1.160.0040.01615.79
7.1.150.0130.00715.82
7.1.140.0090.01315.81
7.1.130.0060.01215.71
7.1.120.0070.00715.97
7.1.110.0030.01315.82
7.1.100.0030.01415.57
7.1.90.0090.00915.72
7.1.80.0070.01316.02
7.1.70.0050.01116.33
7.1.60.0130.01117.62
7.1.50.0110.01316.26
7.1.40.0100.01015.77
7.1.30.0120.00915.92
7.1.20.0030.01515.84
7.1.10.0130.00615.92
7.1.00.0030.02819.14
7.0.330.0000.02015.41
7.0.320.0110.01115.58
7.0.310.0040.01815.47
7.0.300.0060.01315.48
7.0.290.0040.01415.57
7.0.280.0060.01215.50
7.0.270.0070.01115.48
7.0.260.0000.01915.14
7.0.250.0040.01215.45
7.0.240.0060.01315.42
7.0.230.0070.01315.22
7.0.220.0110.01115.45
7.0.210.0030.01615.41
7.0.200.0050.01116.13
7.0.190.0100.00715.47
7.0.180.0110.01115.41
7.0.170.0040.01815.57
7.0.160.0070.01015.44
7.0.150.0130.00615.36
7.0.140.0030.04818.82
7.0.130.0030.01315.41
7.0.120.0030.01315.45
7.0.110.0000.02215.34
7.0.100.0030.01515.55
7.0.90.0040.01215.40
7.0.80.0230.04817.56
7.0.70.0160.04117.72
7.0.60.0150.04017.73
7.0.50.0130.05017.76
7.0.40.0100.04416.78
7.0.30.0110.05016.67
7.0.20.0100.04916.67
7.0.10.0080.04716.75
7.0.00.0050.05216.61
5.6.400.0060.01914.35
5.6.390.0000.02814.47
5.6.380.0030.03114.35
5.6.370.0070.02314.48
5.6.360.0040.02114.32
5.6.350.0070.02014.34
5.6.340.0060.01914.37
5.6.330.0100.01614.57
5.6.320.0090.01614.76
5.6.310.0060.01314.57
5.6.300.0030.02414.70
5.6.290.0100.02214.25
5.6.280.0050.05217.78
5.6.270.0000.02614.14
5.6.260.0000.02514.19
5.6.250.0100.01714.22
5.6.240.0070.01714.37
5.6.230.0120.04917.58
5.6.220.0080.04717.64
5.6.210.0120.05017.50
5.6.200.0070.05917.81
5.6.190.0080.05317.96
5.6.180.0050.05317.80
5.6.170.0150.04317.66
5.6.160.0070.05717.78
5.6.150.0100.06017.65
5.6.140.0100.05017.74
5.6.130.0130.04517.80
5.6.120.0050.05717.87
5.6.110.0050.05817.72
5.6.100.0050.05817.78
5.6.90.0100.05417.71
5.6.80.0110.04817.34
5.6.70.0100.05217.30
5.6.60.0070.04717.45
5.6.50.0050.05017.47
5.6.40.0100.04817.48
5.6.30.0020.03517.34
5.6.20.0050.03217.30
5.6.10.0020.03617.31
5.6.00.0000.03717.42
5.5.380.0070.02414.46
5.5.370.0050.05117.25
5.5.360.0100.05017.23
5.5.350.0090.05517.27
5.5.340.0050.05917.61
5.5.330.0090.05117.80
5.5.320.0070.05517.51
5.5.310.0110.05317.40
5.5.300.0130.04617.63
5.5.290.0080.05417.62
5.5.280.0080.05117.47
5.5.270.0070.05017.71
5.5.260.0050.05117.46
5.5.250.0050.05817.53
5.5.240.0020.05617.43
5.5.230.0100.05017.16
5.5.220.0100.05017.16
5.5.210.0030.05817.42
5.5.200.0120.05717.08
5.5.190.0100.04517.31
5.5.180.0030.05017.28
5.5.170.0090.01514.36
5.5.160.0070.03217.25
5.5.150.0070.02817.30
5.5.140.0020.04117.22
5.5.130.0050.04217.25
5.5.120.0030.03517.38
5.5.110.0050.03617.40
5.5.100.0080.03817.23
5.5.90.0030.03617.27
5.5.80.0030.03417.13
5.5.70.0030.04517.10
5.5.60.0120.02317.15
5.5.50.0020.03817.27
5.5.40.0100.02817.35
5.5.30.0070.04517.12
5.5.20.0080.04417.05
5.5.10.0050.03217.21
5.5.00.0020.03717.10
5.4.450.0070.05215.87
5.4.440.0080.05415.91
5.4.430.0070.05315.82
5.4.420.0120.04815.89
5.4.410.0080.04815.87
5.4.400.0120.04515.74
5.4.390.0030.05515.70
5.4.380.0050.04715.64
5.4.370.0030.05615.72
5.4.360.0110.04815.73
5.4.350.0050.05015.66
5.4.340.0030.03215.66
5.4.330.0000.02112.35
5.4.320.0050.03215.72
5.4.310.0030.03415.79
5.4.300.0030.02815.69
5.4.290.0050.03515.82
5.4.280.0080.03515.74
5.4.270.0030.04015.64
5.4.260.0020.04215.78
5.4.250.0020.03615.74
5.4.240.0050.04015.64
5.4.230.0050.02915.73
5.4.220.0080.04315.72
5.4.210.0110.04115.70
5.4.200.0030.05015.76
5.4.190.0030.03015.77
5.4.180.0030.04615.72
5.4.170.0030.03115.71
5.4.160.0090.04715.81
5.4.150.0050.03715.63
5.4.140.0050.03014.44
5.4.130.0080.02814.40
5.4.120.0100.02814.30
5.4.110.0070.03314.46
5.4.100.0050.02714.46
5.4.90.0020.03014.46
5.4.80.0050.02614.39
5.4.70.0030.03014.38
5.4.60.0060.04614.38
5.4.50.0050.05114.41
5.4.40.0050.05014.35
5.4.30.0030.05514.42
5.4.20.0070.03014.36
5.4.10.0070.04814.41
5.4.00.0000.05614.24
5.3.290.0080.04414.24
5.3.280.0080.04714.24
5.3.270.0020.03814.24
5.3.260.0030.04014.24
5.3.250.0030.03614.24
5.3.240.0070.05314.24
5.3.230.0080.03414.24
5.3.220.0050.03814.24
5.3.210.0030.03214.24
5.3.200.0050.03214.24
5.3.190.0020.03914.24
5.3.180.0020.03414.24
5.3.170.0020.03614.24
5.3.160.0050.05214.24
5.3.150.0030.03714.24
5.3.140.0030.05114.24
5.3.130.0030.06614.24
5.3.120.0020.05114.24
5.3.110.0050.05614.24
5.3.100.0070.05814.24
5.3.90.0080.05614.24
5.3.80.0080.03914.24
5.3.70.0050.05714.24
5.3.60.0050.06014.24
5.3.50.0100.04114.24
5.3.40.0020.05914.24
5.3.30.0090.05414.24
5.3.20.0200.04214.24
5.3.10.0050.04414.24
5.3.00.0080.05114.24
5.2.170.0130.06716.12
5.2.160.0030.07016.12
5.2.150.0130.06316.12
5.2.140.0030.06016.12
5.2.130.0000.08016.12
5.2.120.0130.06016.12
5.2.110.0030.04716.12
5.2.100.0030.08016.12
5.2.90.0070.07316.12
5.2.80.0030.04716.12
5.2.70.0070.06316.12
5.2.60.0030.07316.12
5.2.50.0130.06316.12
5.2.40.0000.08016.12
5.2.30.0070.07316.12
5.2.20.0030.07316.12
5.2.10.0070.07016.12
5.2.00.0070.08016.12
5.1.60.0130.06316.12
5.1.50.0130.05316.12
5.1.40.0030.06316.12
5.1.30.0030.07316.12
5.1.20.0070.06716.12
5.1.10.0100.05016.12
5.1.00.0070.04716.12
5.0.50.0000.03716.12
5.0.40.0070.05316.12
5.0.30.0070.07016.12
5.0.20.0070.06016.12
5.0.10.0030.05016.12
5.0.00.0030.07716.12
4.4.90.0070.03316.12
4.4.80.0000.03716.12
4.4.70.0070.03316.12
4.4.60.0000.04016.12
4.4.50.0030.03716.12
4.4.40.0000.05716.12
4.4.30.0000.03716.12
4.4.20.0000.04016.12
4.4.10.0000.03316.12
4.4.00.0000.03316.12
4.3.110.0070.03016.12
4.3.100.0070.03316.12
4.3.90.0030.02716.12
4.3.80.0070.05016.12
4.3.70.0070.03016.12
4.3.60.0100.02716.12
4.3.50.0000.03716.12
4.3.40.0000.04316.12
4.3.30.0030.02716.12
4.3.20.0000.02316.12
4.3.10.0000.02316.12
4.3.00.0030.02016.12

preferences:
33.26 ms | 401 KiB | 5 Q