3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $ref; function __construct () { $this->ref = new class() { public $name; public function sayName() : string { return $this->name; } }; } public function create (string $name) : class@anonymous { $this->ref->name = $name; return clone $this->ref; } } $A = new A(); $testA = $A->create("matti"); $testB = $A->create("Pekka"); var_dump($testA);

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.00.0100.07720.02
5.6.160.0000.04320.47
5.6.150.0070.08318.17
5.6.140.0030.04318.14
5.6.130.0030.07018.18
5.6.120.0070.08021.14
5.6.110.0100.07720.98
5.6.100.0100.08020.99
5.6.90.0330.05020.88
5.6.80.0070.08020.51
5.5.300.0100.05317.97
5.5.290.0100.04317.99
5.5.280.0000.05320.77
5.5.270.0130.05020.84
5.5.260.0000.04720.83
5.5.250.0100.06320.69
5.5.240.0270.06320.16

preferences:
138.77 ms | 1394 KiB | 7 Q