3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ComplicatedConstructor { public function __construct( public readonly int $integer, public readonly float $float, public readonly bool $boolean, public readonly string $string, private ?\Closure $closure = null, public readonly float|string|null $optional = 'optional', ) {} } $outOfOrderArray = [ 'optional' => 'The optional', 'string' => 'The string', 'float' => (float) '42.5', 'integer' => 9001, 'boolean' => !true, ]; var_dump(new ComplicatedConstructor(...$outOfOrderArray));

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.60.0170.00716.53
8.5.30.0210.00716.53
8.4.60.0210.00617.66
8.3.310.0290.01418.34
8.3.20.0100.00717.86
8.2.310.0110.01118.11
8.2.70.0140.00817.73
8.2.00.0150.00719.47
8.1.340.0210.00717.50
8.1.00.0160.00717.49
8.0.300.0240.00816.85
7.4.20.0270.00316.08

preferences:
34.45 ms | 528 KiB | 5 Q