3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); final class Foo implements \Stringable { private function __construct(public readonly string $value) { } public static function fromString(string $string): self { return new self($string); } /** * {@inheritdoc} */ public function __toString(): string { return $this->value; } } $options = [ Foo::fromString('c'), Foo::fromString('b'), Foo::fromString('a'), Foo::fromString('ccc'), Foo::fromString('bcc'), ]; function foo(string $a, string $b): int { return 1; } uasort($options, 'foo'); var_export($options);

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.5.70.0050.00416.58
8.5.60.0100.00916.87
8.5.50.0100.00716.82
8.4.220.0060.00719.49
8.4.210.0080.00119.43
8.4.90.0040.00517.80
8.3.310.0130.00718.46
8.3.300.0110.00518.21
8.3.180.0090.00616.68
8.3.50.0040.00316.74
8.2.310.0100.01018.10

preferences:
54.93 ms | 533 KiB | 5 Q