3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); final readonly class Version { private string $version; private function __construct( string $version ){ // TODO: ensure is valid $this->version = $version; } public static function fromString(string $string): self { return new self($string); } } final readonly class Example { private ?Version $modifiedVersionForCloning = null; public function __construct( public Version $version ) {} public function __clone() { $this->version = $this->modifiedVersionForCloning; $this->modifiedVersionForCloning = null; } public function lol(string $version): self { $this->modifiedVersionForCloning = Version::fromString($version); $clone = clone $this; return $clone; } } $example = new Example(Version::fromString('8.2')); var_dump($example->lol('8.3'));

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)
8.3.50.0080.00716.66
8.3.30.0110.01022.96
8.3.20.0120.00922.96
8.3.10.0110.00822.96
8.3.00.0110.01122.96
8.2.160.0180.00322.96
8.2.150.0110.00722.96
8.2.140.0130.00322.96
8.2.130.0150.00322.96
8.2.120.0110.00422.96
8.2.110.0180.00322.96
8.2.100.0070.01422.96
8.2.90.0130.00622.96
8.2.80.0140.00422.96
8.2.70.0110.00722.96
8.2.60.0140.00422.96
8.2.50.0030.01322.96
8.2.40.0000.01522.96
8.2.30.0090.00622.96
8.2.20.0100.01022.96
8.2.10.0070.01322.96
8.2.00.0070.00722.96
8.1.270.0090.00622.96
8.1.260.0040.01122.96
8.1.250.0000.01422.96
8.1.240.0070.00722.96
8.1.230.0100.00322.96
8.1.220.0100.00322.96
8.1.210.0140.00022.96
8.1.200.0090.00622.96
8.1.190.0120.00322.96
8.1.180.0040.01122.96
8.1.170.0070.00722.96
8.1.160.0160.00022.96
8.1.150.0090.00622.96
8.1.140.0040.01222.96
8.1.130.0140.00422.96
8.1.120.0100.00722.96
8.1.110.0060.00922.96
8.1.100.0070.01022.96
8.1.90.0090.00922.96
8.1.80.0070.00722.96
8.1.70.0110.00422.96
8.1.60.0140.00322.96
8.1.50.0090.00622.96
8.1.40.0120.00322.96
8.1.30.0000.01422.96
8.1.20.0070.00722.96
8.1.10.0100.00722.96
8.1.00.0030.01422.96

preferences:
55.99 ms | 699 KiB | 4 Q