3v4l.org

run code in 300+ 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] ?? null; if (!$result) { throw new ArrayNotExistsException("Массива под таким ключом не существует. "); } 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.4.120.0140.00722.41
8.4.110.0050.00518.89
8.4.100.0090.01117.29
8.4.90.0110.00920.55
8.4.80.0100.00620.63
8.4.70.0100.00118.82
8.4.60.0100.00920.66
8.4.50.0130.01018.48
8.4.40.0100.01017.59
8.4.30.0090.00919.02
8.4.20.0060.01318.89
8.4.10.0130.00619.18
8.3.250.0070.00217.00
8.3.240.0110.00816.70
8.3.230.0170.00316.53
8.3.220.0090.00618.94
8.3.210.0030.00416.60
8.3.200.0060.00516.51
8.3.190.0110.00918.84
8.3.180.0100.00918.62
8.3.170.0070.01118.66
8.3.160.0090.00318.54
8.3.150.0040.01116.33
8.3.140.0090.00916.70
8.3.130.0040.01118.32
8.3.120.0040.00418.75
8.3.110.0040.01120.94
8.3.100.0040.00716.63
8.3.90.0040.01126.77
8.3.80.0030.00716.48
8.3.70.0060.01216.38
8.3.60.0030.01718.20
8.3.50.0120.00916.45
8.3.40.0070.01120.14
8.3.30.0000.01421.93
8.3.20.0000.00724.18
8.3.10.0030.00524.66
8.3.00.0140.00728.09
8.2.290.0090.01016.77
8.2.280.0120.00718.17
8.2.270.0040.01517.03
8.2.260.0070.01018.10
8.2.250.0090.00016.50
8.2.240.0000.00917.17
8.2.230.0050.00322.58
8.2.220.0040.00424.06
8.2.210.0080.00026.77
8.2.200.0060.00316.75
8.2.190.0090.00616.58
8.2.180.0120.00616.50
8.2.170.0130.00618.73
8.2.160.0100.00322.96
8.2.150.0050.00325.66
8.2.140.0000.00824.66
8.2.130.0090.00928.09
8.2.120.0130.00728.09
8.2.110.0110.00728.09
8.2.100.0130.00628.09
8.2.90.0120.00628.09
8.2.80.0100.01028.09
8.2.70.0110.00728.09
8.2.60.0120.00628.09
8.2.50.0180.00028.09
8.2.40.0030.01628.09
8.2.30.0090.00928.09
8.2.20.0070.01128.09
8.2.10.0150.00628.09
8.2.00.0040.01128.09
8.1.330.0100.00916.07
8.1.320.0080.01015.95
8.1.310.0000.00818.45
8.1.300.0000.00818.22
8.1.290.0030.00630.84
8.1.280.0030.01425.92
8.1.270.0090.00623.79
8.1.260.0090.00628.09
8.1.250.0110.01128.09
8.1.240.0110.00428.09
8.1.230.0140.00028.09
8.1.220.0090.01328.09
8.1.210.0100.01328.09
8.1.200.0130.00728.09
8.1.190.0110.00428.09
8.1.180.0060.00628.09
8.1.170.0040.00428.09
8.1.160.0040.01128.09
8.1.150.0110.00428.09
8.1.140.0130.00328.09
8.1.130.0090.00028.09
8.1.120.0040.01128.09
8.1.110.0150.00028.09
8.1.100.0070.00728.09
8.1.90.0070.00728.09
8.1.80.0080.00028.09
8.1.70.0040.00428.09
8.1.60.0040.00428.09
8.1.50.0040.00428.09
8.1.40.0050.00328.09
8.1.30.0060.00328.09
8.1.20.0090.00028.09
8.1.10.0000.00828.09
8.1.00.0000.00928.09

preferences:
28.4 ms | 403 KiB | 5 Q