3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface IMyClass { public function myMeth(); } class Outer { private $greeting; public function __construct($greeting) { $this->greeting = $greeting; } function my_class($name) { return new class($name) implements IMyClass{ public function __construct($name) { $this->name = $name; } public function myMeth() { return 'Hello ' . $this->name; } }; } } echo new Outer('')->my_class('Dwayne')->myMeth();

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.0100.04720.19
7.0.10.0000.05720.06
7.0.00.0070.05020.18
5.6.170.0230.05320.45
5.6.160.0130.06720.41
5.6.150.0100.04318.17
5.6.140.0130.08018.25
5.6.130.0100.04718.23
5.6.120.0070.08320.90
5.6.110.0100.08321.11
5.6.100.0100.08321.03
5.6.90.0130.06720.98
5.6.80.0100.07320.36
5.5.310.0300.04320.51
5.5.300.0130.04318.10
5.5.290.0070.04017.93
5.5.280.0100.08020.80
5.5.270.0070.09020.83
5.5.260.0100.08320.76
5.5.250.0070.08320.71
5.5.240.0270.07320.27

preferences:
144.68 ms | 1394 KiB | 7 Q