3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Validator { private array $rules; public function __construct(array $rules) { $this->rules = $rules; } public function validate (Enrollee $enrollee): ErrorList { $errorList = new ErrorList(); foreach ($this->rules as $fieldName => $checklist) { foreach ($checklist as $rule) { $result = $rule($enrollee->get($fieldName)); if (!$result===null) { $errorList->add($fieldName, new Error($result)); } } } return $errorList; } }

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.0060.00424.17
8.4.110.0120.00822.66
8.4.100.0100.01018.53
8.4.90.0120.00719.04
8.4.80.0070.00518.19
8.4.70.0080.00817.89
8.4.60.0070.00318.87
8.4.50.0150.00718.59
8.4.40.0100.01017.19
8.4.30.0000.00918.71
8.4.20.0100.01018.58
8.4.10.0080.00619.15
8.3.250.0130.00518.68
8.3.240.0040.00417.08
8.3.230.0100.01016.61
8.3.220.0040.00418.73
8.3.210.0100.00916.49
8.3.200.0040.00416.48
8.3.190.0130.00716.98
8.3.180.0100.00818.73
8.3.170.0060.01320.68
8.3.160.0090.00917.15
8.3.150.0120.00616.97
8.3.140.0040.00416.66
8.3.130.0130.00716.38
8.3.120.0030.00620.69
8.3.110.0060.00320.94
8.3.100.0000.00816.47
8.3.90.0050.00326.77
8.3.80.0000.00918.30
8.3.70.0120.00616.75
8.3.60.0120.00918.43
8.3.50.0100.00716.66
8.3.40.0050.01020.42
8.3.30.0070.00721.71
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0070.01328.09
8.2.290.0110.00820.28
8.2.280.0060.00318.36
8.2.270.0040.00418.84
8.2.260.0070.01316.36
8.2.250.0100.00018.10
8.2.240.0110.00717.09
8.2.230.0040.00422.58
8.2.220.0080.00024.06
8.2.210.0090.00026.77
8.2.200.0090.00018.29
8.2.190.0040.01218.16
8.2.180.0100.00725.92
8.2.170.0070.01018.79
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0120.00628.09
8.2.120.0140.00428.09
8.2.110.0120.00628.09
8.2.100.0090.00928.09
8.2.90.0160.00328.09
8.2.80.0090.00928.09
8.2.70.0030.01728.09
8.2.60.0080.00828.09
8.2.50.0090.01228.09
8.2.40.0130.00728.09
8.2.30.0100.00628.09
8.2.20.0120.00328.09
8.2.10.0120.00428.09
8.2.00.0100.00628.09
8.1.330.0130.00821.91
8.1.320.0100.01115.90
8.1.310.0060.00316.69
8.1.300.0080.00618.19
8.1.290.0060.00330.84
8.1.280.0110.00725.92
8.1.270.0160.00321.82
8.1.260.0070.00728.09
8.1.250.0100.00328.09
8.1.240.0080.00028.09
8.1.230.0030.01028.09
8.1.220.0070.01128.09
8.1.210.0030.00628.09
8.1.200.0030.00528.09
8.1.190.0120.00628.09
8.1.180.0030.00528.09
8.1.170.0070.00328.09
8.1.160.0040.00428.09
8.1.150.0040.00428.09
8.1.140.0070.01128.09
8.1.130.0040.00428.09
8.1.120.0080.00028.09
8.1.110.0030.00628.09
8.1.100.0110.01128.09
8.1.90.0090.00928.09
8.1.80.0050.00528.09
8.1.70.0040.00428.09
8.1.60.0040.00428.09
8.1.50.0030.00528.09
8.1.40.0030.01728.09
8.1.30.0030.00628.09
8.1.20.0030.01628.09
8.1.10.0040.01128.09
8.1.00.0040.00428.09

preferences:
40.08 ms | 403 KiB | 5 Q