3v4l.org

run code in 300+ PHP versions simultaneously
<?php class YearIsValid implements ValidatorRuleInterface { private string $errorText; private int $minYear; private int $maxYear; public function __construct(int $minYear, int $maxYear) { $this->minYear = $minYear; $this->maxYear = $maxYear; $this->errorText = "Год рождения не может быть меньше $this->minYear и не может быть больше $this->maxYear."; } public function __invoke(mixed $value): ?ValidationError { if (!is_int($value)) { throw new TypeException("Неправильный тип данных в аргументе функции."); } $resultMin = $value < $minYear; $resultMax = $value > $maxYear; if ($resultMin || $resultMax) { return new ValidationError($this->errorText); } else { return null; } } }

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.0100.01018.50
8.4.110.0040.00523.99
8.4.100.0120.00917.63
8.4.90.0130.00920.30
8.4.80.0130.00719.09
8.4.70.0040.00518.95
8.4.60.0110.00620.69
8.4.50.0090.00018.49
8.4.40.0070.01417.61
8.4.30.0100.01018.60
8.4.20.0060.00318.85
8.4.10.0160.00319.41
8.3.250.0090.01116.84
8.3.240.0160.00316.68
8.3.230.0060.00316.66
8.3.220.0100.00818.66
8.3.210.0070.00518.43
8.3.200.0040.00416.75
8.3.190.0060.00217.22
8.3.180.0130.00719.00
8.3.170.0070.01117.33
8.3.160.0080.00017.27
8.3.150.0110.00716.77
8.3.140.0000.00816.92
8.3.130.0050.00318.40
8.3.120.0060.00318.86
8.3.110.0090.00020.94
8.3.100.0080.00016.81
8.3.90.0140.00326.77
8.3.80.0050.00517.97
8.3.70.0070.01116.63
8.3.60.0080.00818.43
8.3.50.0150.00616.85
8.3.40.0140.00720.37
8.3.30.0080.00621.90
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0140.00728.09
8.2.290.0130.00716.76
8.2.280.0130.00618.52
8.2.270.0180.00018.45
8.2.260.0070.00717.02
8.2.250.0040.00418.49
8.2.240.0100.00718.63
8.2.230.0000.00822.58
8.2.220.0000.01124.06
8.2.210.0080.00026.77
8.2.200.0030.00616.50
8.2.190.0070.00716.63
8.2.180.0070.00716.38
8.2.170.0100.00719.04
8.2.160.0030.01422.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0100.01028.09
8.2.120.0090.00928.09
8.2.110.0110.00728.09
8.2.100.0160.00328.09
8.2.90.0130.00328.09
8.2.80.0150.00628.09
8.2.70.0110.00728.09
8.2.60.0070.01028.09
8.2.50.0130.00728.09
8.2.40.0110.00728.09
8.2.30.0120.00628.09
8.2.20.0090.00628.09
8.2.10.0090.00628.09
8.2.00.0150.00028.09
8.1.330.0120.00716.34
8.1.320.0110.00818.13
8.1.310.0070.01116.56
8.1.300.0030.00716.10
8.1.290.0040.00730.84
8.1.280.0100.01025.92
8.1.270.0120.00420.64
8.1.260.0050.00328.09
8.1.250.0090.00028.09
8.1.240.0030.00628.09
8.1.230.0070.01328.09
8.1.220.0030.00628.09
8.1.210.0060.00328.09
8.1.200.0050.00328.09
8.1.190.0030.00528.09
8.1.180.0090.00928.09
8.1.170.0090.00928.09
8.1.160.0110.00728.09
8.1.150.0100.00628.09
8.1.140.0000.01428.09
8.1.130.0050.00328.09
8.1.120.0120.00628.09
8.1.110.0030.01228.09
8.1.100.0070.00728.09
8.1.90.0120.00328.09
8.1.80.0060.01228.09
8.1.70.0070.01028.09
8.1.60.0040.00428.09
8.1.50.0060.00328.09
8.1.40.0150.00028.09
8.1.30.0060.00328.09
8.1.20.0150.00028.09
8.1.10.0090.00628.09
8.1.00.0120.00628.09

preferences:
27.51 ms | 403 KiB | 5 Q