3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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; } class Foo2 { public function fooLoop() { for ($i = 1000000; $i--;) $this->foo(); } public function barLoop() { for ($i = 1000000; $i--;) $this->bar(); } public function bazLoop() { for ($i = 1000000; $i--;) $this->baz(); } public function foo() { } protected function bar() { } private function baz() { } } $f = new Foo2(); test(); $f->fooLoop(); test('pub'); $f->barLoop(); test('pro'); $f->bazLoop(); test('pri');

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.10.0100.06316.73
7.3.00.0070.07116.41
7.2.130.0070.07416.75
7.2.120.0070.09217.00
7.2.110.0030.09116.71
7.2.100.0030.08216.79
7.2.90.0880.10215.75
7.2.80.0760.07615.64
7.2.70.0030.07815.89
7.2.60.0130.07915.97
7.2.50.0200.09215.98
7.2.40.0240.09015.72
7.2.30.0090.07915.64
7.2.20.0120.08415.94
7.2.10.0160.09015.98
7.2.00.0760.08415.88
7.1.250.0100.19715.84
7.1.210.2100.08714.16
7.1.200.1380.10813.90
7.1.190.0450.08013.94
7.1.180.1050.07913.79
7.1.170.0620.08613.83
7.1.160.0350.07913.77
7.1.150.1280.07913.96
7.1.140.0960.14114.07
7.1.130.0190.07814.08
7.1.120.0130.09613.70
7.1.110.0100.08813.83
7.1.100.0410.07614.01
7.1.90.0110.07513.90
7.1.80.0100.09213.73
7.1.70.0740.09313.70
7.1.60.0590.07631.65
7.1.50.0550.08432.11
7.1.40.0690.11531.72
7.1.30.0970.09231.90
7.1.20.1380.09131.86
7.1.10.0130.13213.76
7.1.00.0100.08313.99
7.0.310.0340.08413.39
7.0.300.0260.08713.59
7.0.290.0070.09113.44
7.0.280.0250.14313.31
7.0.270.1600.09813.53
7.0.260.0170.08513.30
7.0.250.0820.08613.39
7.0.240.0140.08613.39
7.0.230.0140.08113.30
7.0.220.0030.09213.32
7.0.210.0100.09313.18
7.0.200.0230.08413.27
7.0.190.0090.10013.34
7.0.180.0190.08413.27
7.0.170.0330.08713.64
7.0.160.0470.10613.49
7.0.150.0160.08213.47
7.0.140.0030.13313.57
7.0.130.0380.07513.53
7.0.120.0260.08913.59
7.0.110.0760.11313.52
7.0.100.0190.10513.46
7.0.90.0520.10313.11
7.0.80.0710.08113.46
7.0.70.0100.07913.28
7.0.60.0190.09013.31
7.0.50.0090.10113.33
7.0.40.0160.12113.59
7.0.30.0140.08713.62
7.0.20.1470.12013.29
7.0.10.0100.09413.73
7.0.00.0620.08013.54

preferences:
33.94 ms | 400 KiB | 5 Q