3v4l.org

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

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.0000.05720.21
5.6.160.0100.03720.63
5.6.150.0030.05318.18
5.6.140.0070.07018.21
5.6.130.0070.05718.11
5.6.120.0170.07321.00
5.6.110.0070.04020.89
5.6.100.0130.08020.94
5.6.90.0030.08721.10
5.6.80.0070.07720.45
5.5.300.0100.06318.07
5.5.290.0070.07317.96
5.5.280.0000.04320.68
5.5.270.0100.06320.73
5.5.260.0070.08320.79
5.5.250.0070.07320.77
5.5.240.0130.07720.29

preferences:
139.56 ms | 1394 KiB | 7 Q