3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (PHP_VERSION !== '7.2.0alpha2') die('Meh'); function test($label = '') { global $t; $t2 = microtime(1); if ($label) echo str_pad($label . ': ', 32, '.', STR_PAD_RIGHT) . ' ' . 1000 * ($t2 - $t) . 'ms' . "\n"; $t = $t2; } $c = 1; $c2 = 1; class A { public $a = 123; public function __construct() { unset($this->a); } public function a1() { } public function a2() { fopen('php://input'); } public function __get($name) { return 321; } } test(); for ($i = $c; $i--;) { $a = new A(); for ($j = $c2; $j--;) { $x = $a->a; } } test('__get'); for ($i = $c; $i--;) { $a = new A(); for ($j = $c2; $j--;) { $x = $a->a1(); } } test('empty()'); for ($i = $c; $i--;) { $a = new A(); for ($j = $c2; $j--;) { $x = $a->a2(); } } test('fopen()');

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.0100.00714.89
7.4.00.0070.01314.94
7.3.130.0090.00914.69
7.3.120.0030.01614.69
7.3.110.0030.01314.80
7.3.100.0040.01214.54
7.3.90.0070.00714.53
7.3.80.0120.00014.82
7.3.70.0060.00314.86
7.3.60.0000.01414.67
7.3.50.0100.00614.58
7.3.40.0030.00914.72
7.3.30.0090.00314.72
7.3.20.0100.00716.61
7.3.10.0070.00916.64
7.3.00.0090.00416.58
7.2.260.0070.01114.71
7.2.250.0030.01015.07
7.2.240.0030.01314.97
7.2.230.0080.00414.93
7.2.220.0000.00914.90
7.2.210.0040.01114.66
7.2.200.0110.00015.11
7.2.190.0030.01614.88
7.2.180.0090.00614.77
7.2.170.0090.00615.05
7.2.160.0070.00715.04
7.2.150.0060.00916.80
7.2.140.0030.01216.63
7.2.130.0020.01116.73
7.2.120.0030.01116.63
7.2.110.0070.00616.53
7.2.100.0070.00916.79
7.2.90.0050.00715.96
7.2.80.0990.00815.97
7.2.70.0050.00916.03
7.2.60.0080.00516.01
7.2.50.0090.00716.06
7.2.40.0070.00716.13
7.2.30.0070.00816.15
7.2.20.0140.00716.15
7.2.10.0130.01216.08
7.2.00.0070.00716.07
7.1.330.0070.00715.79
7.1.320.0050.00315.62
7.1.310.0000.01415.74
7.1.300.0070.00715.63
7.1.290.0060.01015.73
7.1.280.0060.00915.69
7.1.270.0070.00715.76
7.1.260.0000.01815.66
7.1.250.0080.00315.48
7.1.240.0030.01115.69
7.1.230.0070.01015.70
7.1.220.0070.01015.55
7.1.210.1350.00814.68
7.1.200.0090.00714.62
7.1.190.0080.00514.76
7.1.180.0090.01014.62
7.1.170.0460.00314.66
7.1.160.0080.00514.61
7.1.150.0080.00614.66
7.1.140.0060.00914.75
7.1.130.0100.00514.71
7.1.120.0100.00514.64
7.1.110.0080.00614.68
7.1.100.1330.00214.72
7.1.90.0070.00714.76
7.1.80.0350.00714.41
7.1.70.1000.00814.72
7.1.60.0150.01423.86
7.1.50.0300.01123.95
7.1.40.0250.00923.56
7.1.30.0140.01123.60
7.1.20.0170.01323.59
7.1.10.0890.00814.72
7.1.00.0130.00714.56
7.0.330.0000.01315.20
7.0.320.0110.00415.05
7.0.310.1320.01014.28
7.0.300.0050.00914.11
7.0.290.0190.00714.28
7.0.280.0060.01014.28
7.0.270.0040.01114.26
7.0.260.0060.00614.21
7.0.250.0070.00914.35
7.0.240.0550.00714.19
7.0.230.0770.00814.13
7.0.220.0070.00914.38
7.0.210.1200.00914.38
7.0.200.0060.00814.25
7.0.190.0140.00214.24
7.0.180.0770.00414.28
7.0.170.0390.00914.31
7.0.160.0060.01114.46
7.0.150.0740.00914.29
7.0.140.0620.00614.33
7.0.130.0050.00814.32
7.0.120.0280.00614.25
7.0.110.0100.00314.52
7.0.100.0030.00714.21
7.0.90.0290.00414.37
7.0.80.0600.01014.21
7.0.70.0100.00814.27
7.0.60.0060.00614.38
7.0.50.0080.00514.46
7.0.40.0060.00813.31
7.0.30.0200.00913.41
7.0.20.0500.01013.29
7.0.10.0030.01013.45
7.0.00.0030.01213.50
5.6.400.0120.00614.10
5.6.390.0090.00614.04
5.6.380.0090.00914.30
5.6.370.0030.00614.39
5.6.360.0000.01214.57
5.6.350.0100.00614.53
5.6.340.0050.00314.29
5.6.330.0000.01114.14
5.6.320.0040.00714.05
5.6.310.0060.01314.52
5.6.300.0000.01313.84
5.6.290.0030.00614.52
5.6.280.0070.00714.18
5.6.270.0030.00914.34
5.6.260.0000.01314.25
5.6.250.0030.00514.26
5.6.240.0110.00714.45
5.6.230.0130.00314.36
5.6.220.0030.00614.28
5.6.210.0060.00614.27
5.6.200.0060.00614.11
5.6.190.0040.00714.59
5.6.180.0100.00314.27
5.6.170.0040.00814.09
5.6.160.0060.00314.24
5.6.150.0090.00014.18
5.6.140.0000.01114.24
5.6.130.0030.00614.36
5.6.120.0080.00414.50
5.6.110.0070.00714.25
5.6.100.0050.00314.09
5.6.90.0040.00714.16
5.6.80.0030.01014.07
5.6.70.0000.01414.16
5.6.60.0080.00814.34
5.6.50.0000.00814.09
5.6.40.0070.00714.11
5.6.30.0090.00314.32
5.6.20.0040.00414.28
5.6.10.0030.00814.26
5.6.00.0080.00414.24

preferences:
35.71 ms | 401 KiB | 5 Q