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.4.90.0040.00517.80
8.3.300.0110.00518.21
8.3.180.0090.00616.68
8.3.50.0040.00316.74

preferences:
47.59 ms | 502 KiB | 5 Q