3v4l.org

run code in 500+ 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) { $errorList->add($fieldName, $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.5.60.0090.01016.50
8.5.50.0050.00416.64
8.5.30.0100.00719.27
8.5.20.0080.00917.99
8.5.10.0070.00416.22
8.5.00.0140.00619.47
8.4.210.0090.01121.14
8.4.180.0140.00919.59
8.4.170.0150.00723.71
8.4.160.0180.00523.04
8.4.150.0120.00716.69
8.4.140.0130.00917.16
8.4.130.0140.00717.62
8.4.120.0160.00520.44
8.4.110.0110.00922.25
8.4.100.0050.00918.62
8.4.90.0090.00818.54
8.4.80.0060.00317.69
8.4.70.0120.00818.00
8.4.60.0110.01018.65
8.4.50.0130.00718.52
8.4.40.0130.00617.54
8.4.30.0210.00018.60
8.4.20.0060.00919.05
8.4.10.0080.00819.13
8.3.300.0110.00920.86
8.3.290.0140.00820.70
8.3.280.0110.00918.55
8.3.270.0070.01216.43
8.3.260.0100.01116.26
8.3.250.0110.00718.75
8.3.240.0110.00917.18
8.3.230.0100.00916.35
8.3.220.0090.00918.96
8.3.210.0110.00616.60
8.3.200.0080.00216.48
8.3.190.0040.00517.07
8.3.180.0100.00916.57
8.3.170.0110.00718.72
8.3.160.0030.00518.42
8.3.150.0100.01016.52
8.3.140.0080.00016.46
8.3.130.0070.00317.09
8.3.120.0090.00918.67
8.3.110.0030.00620.94
8.3.100.0040.00416.42
8.3.90.0060.00326.77
8.3.80.0050.00516.63
8.3.70.0000.02116.38
8.3.60.0110.00416.38
8.3.50.0150.00616.46
8.3.40.0140.00420.30
8.3.30.0070.00721.79
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0170.00328.09
8.2.300.0120.00820.20
8.2.290.0040.00522.12
8.2.280.0110.00718.19
8.2.270.0090.00917.04
8.2.260.0070.01118.43
8.2.250.0000.00816.55
8.2.240.0040.00416.90
8.2.230.0080.00022.58
8.2.220.0060.00324.06
8.2.210.0080.00026.77
8.2.200.0040.00416.25
8.2.190.0110.00716.58
8.2.180.0110.00718.04
8.2.170.0140.00418.82
8.2.160.0090.00922.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0130.00628.09
8.2.120.0090.00928.09
8.2.110.0070.01128.09
8.2.100.0170.00328.09
8.2.90.0090.00928.09
8.2.80.0040.01128.09
8.2.70.0100.01028.09
8.2.60.0170.00328.09
8.2.50.0120.00328.09
8.2.40.0100.01028.09
8.2.30.0040.01128.09
8.2.20.0120.00628.09
8.2.10.0130.00628.09
8.2.00.0130.00728.09
8.1.340.0130.00817.51
8.1.330.0100.00821.74
8.1.320.0130.00616.15
8.1.310.0040.00418.27
8.1.300.0100.00017.92
8.1.290.0030.00630.84
8.1.280.0130.00925.92
8.1.270.0080.00023.79
8.1.260.0100.01028.09
8.1.250.0040.01528.09
8.1.240.0090.00928.09
8.1.230.0130.00628.09
8.1.220.0180.00328.09
8.1.210.0170.00328.09
8.1.200.0100.01028.09
8.1.190.0030.01728.09
8.1.180.0100.01028.09
8.1.170.0100.00628.09
8.1.160.0070.00728.09
8.1.150.0110.00428.09
8.1.140.0150.00028.09
8.1.130.0040.00828.09
8.1.120.0060.00328.09
8.1.110.0000.00928.09
8.1.100.0080.00828.09
8.1.90.0060.00328.09
8.1.80.0060.00328.09
8.1.70.0030.00528.09
8.1.60.0030.00628.09
8.1.50.0040.00428.09
8.1.40.0040.00428.09
8.1.30.0140.00328.09
8.1.20.0110.00728.09
8.1.10.0040.00428.09
8.1.00.0040.00428.09

preferences:
87.44 ms | 978 KiB | 5 Q