3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ErrorList { private array $errors; public function add(string $fieldName, ValidationError $validationError): void { $this->errors[$fieldName][] = $validationError; } public function getListOfFieldErrors(string $fieldName): array { $result = $this->errors[$fieldName] ?? []; foreach ($result as $key => $error) { $result [$key] = $error->get("text"); } return $result; } public function isEmpty(): bool { return empty($this->errors); } }

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.80.0060.00316.72
8.5.70.0100.00616.52
8.5.60.0110.01016.66
8.5.50.0110.00916.62
8.5.30.0080.00921.30
8.5.20.0080.01018.00
8.5.10.0110.00816.55
8.5.00.0130.00920.05
8.4.230.0160.00819.39
8.4.220.0050.00319.48
8.4.210.0110.01019.40
8.4.180.0100.01122.04
8.4.170.0130.00723.91
8.4.160.0100.01123.01
8.4.150.0080.00416.76
8.4.140.0110.00917.46
8.4.130.0110.00917.71
8.4.120.0110.00920.55
8.4.110.0090.00622.46
8.4.100.0110.00920.61
8.4.90.0120.00918.81
8.4.80.0110.00917.70
8.4.70.0150.00517.81
8.4.60.0110.00918.92
8.4.50.0090.01120.54
8.4.40.0090.00617.60
8.4.30.0050.00318.73
8.4.20.0070.01319.09
8.4.10.0090.00019.00
8.3.320.0090.01218.29
8.3.310.0080.00318.22
8.3.300.0080.01320.68
8.3.290.0110.01020.73
8.3.280.0100.00920.03
8.3.270.0120.00716.54
8.3.260.0110.00816.46
8.3.250.0080.01018.62
8.3.240.0050.00316.59
8.3.230.0130.00516.72
8.3.220.0130.00617.23
8.3.210.0110.00518.20
8.3.200.0060.00616.33
8.3.190.0130.00917.18
8.3.180.0120.00716.48
8.3.170.0070.01018.87
8.3.160.0120.00620.28
8.3.150.0160.00318.98
8.3.140.0050.00316.38
8.3.130.0090.00016.52
8.3.120.0000.00818.95
8.3.110.0040.00420.94
8.3.100.0000.00924.06
8.3.90.0030.00726.77
8.3.80.0030.00718.18
8.3.70.0040.01116.50
8.3.60.0120.00918.55
8.3.50.0040.01118.24
8.3.40.0090.00620.20
8.3.30.0090.00620.29
8.3.20.0110.00824.18
8.3.10.0000.01524.66
8.3.00.0120.00828.09
8.2.320.0140.00717.96
8.2.310.0060.01517.95
8.2.300.0140.00518.63
8.2.290.0110.00720.48
8.2.280.0120.00618.21
8.2.270.0120.00917.42
8.2.260.0120.00618.29
8.2.250.0090.00016.61
8.2.240.0080.00017.38
8.2.230.0030.00622.58
8.2.220.0060.00337.54
8.2.210.0100.01026.77
8.2.200.0060.00318.16
8.2.190.0040.01116.75
8.2.180.0070.01016.36
8.2.170.0120.00319.01
8.2.160.0170.00322.96
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0120.00928.09
8.2.120.0160.00328.09
8.2.110.0070.01328.09
8.2.100.0110.00728.09
8.2.90.0070.00728.09
8.2.80.0000.00928.09
8.2.70.0200.00028.09
8.2.60.0120.00628.09
8.2.50.0060.00328.09
8.2.40.0080.00028.09
8.2.30.0080.00028.09
8.2.20.0070.00728.09
8.2.10.0070.00728.09
8.2.00.0080.00028.09
8.1.340.0130.00921.27
8.1.330.0080.01021.66
8.1.320.0050.00515.75
8.1.310.0040.00418.61
8.1.300.0090.00017.79
8.1.290.0030.00630.84
8.1.280.0120.00325.92
8.1.270.0090.00623.83
8.1.260.0040.00428.09
8.1.250.0040.01128.09
8.1.240.0040.00428.09
8.1.230.0040.00428.09
8.1.220.0030.00528.09
8.1.210.0040.01128.09
8.1.200.0070.00728.09
8.1.190.0070.00728.09
8.1.180.0070.00728.09
8.1.170.0080.00028.09
8.1.160.0080.00028.09
8.1.150.0040.00428.09
8.1.140.0040.00428.09
8.1.130.0060.00328.09
8.1.120.0120.00328.09
8.1.110.0150.00028.09
8.1.100.0040.01128.09
8.1.90.0070.00428.09
8.1.80.0090.00028.09
8.1.70.0040.00428.09
8.1.60.0040.00428.09
8.1.50.0040.00428.09
8.1.40.0080.00028.09
8.1.30.0030.00528.09
8.1.20.0060.00328.09
8.1.10.0030.00528.09
8.1.00.0050.00328.09

preferences:
68.79 ms | 1019 KiB | 5 Q