3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $fn; function __construct() { $this->fn = function () { $this->bar(); } } public function baz() { $this->fn(); } private function bar() { echo 'bar'; } } $foo = new foo; $foo->baz();

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.0.20.0300.07720.10
7.0.10.0070.05020.12
7.0.00.0100.08320.07
5.6.170.0300.07320.62
5.6.160.0100.07720.54
5.6.150.0000.04018.29
5.6.140.0130.06318.18
5.6.130.0070.07018.14
5.6.120.0070.05320.97
5.6.110.0000.04721.15
5.6.100.0070.05020.89
5.6.90.0070.03720.98
5.6.80.0170.05020.57
5.5.310.0200.04720.27
5.5.300.0070.08017.95
5.5.290.0070.08018.08
5.5.280.0100.07020.85
5.5.270.0100.07320.77
5.5.260.0030.08720.65
5.5.250.0070.04020.50
5.5.240.0230.07320.25

preferences:
136.92 ms | 1398 KiB | 7 Q