3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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'), ]; var_dump(strnatcasecmp($options[1], $options[2])); uasort($options, 'strnatcasecmp'); 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.3.300.0150.00619.17

preferences:
48.81 ms | 492 KiB | 5 Q