3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); final readonly class Time { private function __construct( private int $seconds, ) {} public static function fromSeconds(int $seconds): self { return new self($seconds); } } // false var_dump(Time::fromSeconds(0) === Time::fromSeconds(0)); // true var_dump(Time::fromSeconds(0) == Time::fromSeconds(0)); var_dump(Time::fromSeconds(1) > Time::fromSeconds(0)); var_dump(Time::fromSeconds(1) >= Time::fromSeconds(1)); var_dump(Time::fromSeconds(0) < Time::fromSeconds(1)); var_dump(Time::fromSeconds(1) <= Time::fromSeconds(1));

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.120.0120.00319.07
8.3.110.0040.00422.58
8.3.100.0080.00022.58
8.3.90.0160.01126.77
8.3.50.0000.00822.58
8.2.240.0000.00917.25
8.2.230.0000.00822.58
8.2.220.0060.00322.58
8.2.210.0040.00422.58
8.1.300.0110.00418.34

preferences:
26.62 ms | 403 KiB | 5 Q