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('methods'); var_dump($x); for ($i = $c; $i--;) { $a = new A(); for ($j = $c2; $j--;) { $x = $a->a; } } test('methods'); var_dump($x);

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.0060.01214.52
7.3.120.0080.00814.92
7.3.110.0050.01114.78
7.3.100.0070.00814.78
7.3.90.0000.01214.48
7.3.80.0070.00514.81
7.3.70.0040.01014.81
7.3.60.0010.00814.58
7.3.50.0030.00914.57
7.3.40.0030.01114.64
7.3.30.0060.01014.47
7.3.20.0090.00516.64
7.3.10.0060.00816.37
7.3.00.0060.00916.44
7.2.250.0060.01214.74
7.2.240.0100.00714.99
7.2.230.0030.01014.77
7.2.220.0050.00914.99
7.2.210.0070.00514.84
7.2.200.0040.01014.98
7.2.190.0050.00914.91
7.2.180.0080.00514.85
7.2.170.0060.00714.88
7.2.160.0000.01314.96
7.2.150.0000.01416.69
7.2.140.0080.00316.83
7.2.130.0070.01016.80
7.2.120.0040.00816.83
7.2.110.0060.00916.67
7.2.100.0070.00716.75
7.2.90.0180.00315.68
7.2.80.0070.00515.72
7.2.70.1180.00515.55
7.2.60.0870.00715.76
7.2.50.0250.01015.78
7.2.40.0100.00815.84
7.2.30.0060.01115.69
7.2.20.0200.00915.77
7.2.10.0380.00515.52
7.2.00.0110.00415.82
7.1.330.0060.00715.77
7.1.320.0030.00815.64
7.1.310.0060.00515.71
7.1.300.0060.00615.70
7.1.290.0080.00715.53
7.1.280.0080.00615.56
7.1.270.0050.00815.66
7.1.260.0060.00615.46
7.1.250.0030.00715.79
7.1.210.0330.00413.70
7.1.200.0180.00013.68
7.1.190.0110.00013.63
7.1.180.0490.01213.66
7.1.170.0580.00713.86
7.1.160.0190.00413.59
7.1.150.0430.00713.58
7.1.140.0270.01013.41
7.1.130.0090.00913.69
7.1.120.0090.00613.70
7.1.110.0090.00713.88
7.1.100.0250.00613.80
7.1.90.0110.00713.59
7.1.80.0080.00813.71
7.1.70.0060.00613.86
7.1.60.1990.00331.87
7.1.50.0780.01731.90
7.1.40.0410.00331.75
7.1.30.0280.01331.91
7.1.20.0220.00931.88
7.1.10.0140.00313.54
7.1.00.2260.00713.86
7.0.310.0110.00013.50
7.0.300.0690.00713.43
7.0.290.0030.01013.17
7.0.280.0120.00313.31
7.0.270.0120.00613.20
7.0.260.0110.00813.17
7.0.250.3260.00713.23
7.0.240.0370.01013.34
7.0.230.0310.01013.12
7.0.220.0090.00613.35
7.0.210.0060.00913.33
7.0.200.1060.00613.25
7.0.190.1260.00313.50
7.0.180.1400.00713.48
7.0.170.0060.00613.52
7.0.160.0330.00813.58
7.0.150.0080.00513.66
7.0.140.0130.00013.02
7.0.130.0120.00313.48
7.0.120.1560.00013.54
7.0.110.0600.00713.24
7.0.100.0130.00013.49
7.0.90.0880.01113.46
7.0.80.5080.01013.25
7.0.70.1950.00313.21
7.0.60.1950.00713.15
7.0.50.0130.00313.52
7.0.40.0100.00313.52
7.0.30.0250.00313.36
7.0.20.0060.01113.45
7.0.10.0100.00713.70
7.0.00.0100.00713.32

preferences:
35.66 ms | 401 KiB | 5 Q