3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Age { public function __construct(readonly public int $age) { if (0 > $age) { throw new DomainException('Age must be positive integer. "' . $age . '" provided.'); } } public function min(Age $comparingAge): Age { return min($this, $comparingAge); } } $firstAge = new Age(33); $secondAge = new Age(22); $minAge = $firstAge->min($secondAge); var_dump($minAge);

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.120.0110.00920.61
8.4.110.0120.00718.83
8.4.100.0060.00317.84
8.4.90.0150.00618.83
8.4.80.0150.00518.50
8.4.70.0090.00317.93
8.4.60.0140.00618.75
8.4.50.0060.00618.67
8.4.40.0120.00318.37
8.4.30.0110.00818.76
8.4.20.0140.00719.47
8.4.10.0160.00719.35
8.3.250.0130.00718.88
8.3.240.0130.00616.57
8.3.230.0110.00816.46
8.3.220.0110.00620.54
8.3.210.0090.00818.62
8.3.200.0050.00316.48
8.3.190.0110.00417.36
8.3.180.0110.00717.29
8.3.170.0110.00720.86
8.3.160.0120.00617.29
8.3.150.0160.00317.25
8.3.140.0040.01120.72
8.3.130.0120.00618.16
8.3.120.0000.00919.00
8.3.110.0060.00322.58
8.3.100.0000.00822.58
8.3.90.0080.00022.58
8.3.50.0080.00022.58
8.2.290.0090.00918.89
8.2.280.0040.00418.85
8.2.270.0070.01118.88
8.2.260.0070.01318.62
8.2.250.0080.00416.67
8.2.240.0180.00017.18
8.2.230.0000.00922.58
8.2.220.0050.00322.58
8.2.210.0040.00422.58
8.1.330.0100.00917.76
8.1.320.0100.00915.90
8.1.310.0070.00716.80
8.1.300.0030.00619.61
8.1.120.0130.01017.36

preferences:
26.57 ms | 403 KiB | 5 Q