3v4l.org

run code in 300+ PHP versions simultaneously
<?php $errorHandler = new ErrorHandler; set_error_handler([$errorHandler, 'onError']); foreach (['SORT_REGULAR', 'SORT_NUMERIC', 'SORT_STRING', 'SORT_LOCALE_STRING'] as $sort_mode) { echo $sort_mode . ' - '; try { array_unique([new stdClass, new stdClass], constant($sort_mode)); echo 'works'; if ($errors = $errorHandler->getErrors()) { echo ', but with these errors: ' . PHP_EOL; var_dump($errors); $errorHandler->flush(); } else { echo PHP_EOL; } } catch (Throwable $e) { echo 'fails with the following error:' . PHP_EOL; echo $e->getMessage() . PHP_EOL; } echo PHP_EOL; } class ErrorHandler { private $errors = []; public function onError() { $this->errors[] = func_get_args()[1]; return true; } public function flush() { $this->errors = []; } public function getErrors() { return $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.10.0110.00619.91
8.5.00.0150.00820.07
8.4.150.0020.00014.05
8.4.140.0110.01017.77
8.4.130.0100.01017.93
8.4.120.0110.00922.31
8.4.110.0080.00118.92
8.4.100.0080.01019.51
8.4.90.0070.00422.33
8.4.80.0070.00119.04
8.4.70.0100.01118.86
8.4.60.0100.01018.60
8.4.50.0110.01018.56
8.4.40.0100.01019.79
8.4.30.0160.00318.52
8.4.20.0100.01019.91
8.4.10.0040.00421.93
8.3.280.0110.01020.48
8.3.270.0110.00916.88
8.3.260.0110.00816.86
8.3.250.0100.01018.81
8.3.240.0110.00916.72
8.3.230.0120.00517.04
8.3.220.0100.00918.86
8.3.210.0140.00716.91
8.3.200.0070.00416.87
8.3.190.0110.00917.20
8.3.180.0110.00819.16
8.3.170.0110.00718.54
8.3.160.0060.00317.24
8.3.150.0040.01519.02
8.3.140.0150.00418.87
8.3.130.0110.00016.71
8.3.120.0080.01118.80
8.3.110.0040.00420.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0030.00618.68
8.3.70.0130.00618.43
8.3.60.0100.00718.43
8.3.50.0140.00416.85
8.3.40.0170.00322.17
8.3.30.0040.01118.97
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0080.00026.16
8.2.290.0090.00917.04
8.2.280.0110.00818.39
8.2.270.0060.01318.39
8.2.260.0090.00616.82
8.2.250.0080.00016.90
8.2.240.0040.01217.40
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0090.00926.77
8.2.200.0000.01016.75
8.2.190.0070.01416.63
8.2.180.0070.01316.75
8.2.170.0070.00719.08
8.2.160.0100.00722.96
8.2.150.0050.00325.66
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0070.00421.11
8.2.100.0060.00618.03
8.2.90.0050.00319.34
8.2.80.0030.00517.97
8.2.70.0000.00818.04
8.2.60.0000.00817.75
8.2.50.0090.00018.10
8.2.40.0030.00620.64
8.2.30.0030.00619.07
8.2.20.0050.00519.07
8.2.10.0140.00318.92
8.2.00.0110.00718.98
8.1.330.0070.01216.36
8.1.320.0110.00918.27
8.1.310.0100.00716.63
8.1.300.0030.00618.56
8.1.290.0090.00030.84
8.1.280.0040.01525.92
8.1.270.0000.00724.66
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0060.00622.19
8.1.230.0030.01320.84
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0000.00917.48
8.1.190.0000.00817.35
8.1.180.0020.00518.10
8.1.170.0040.00418.50
8.1.160.0040.00418.80
8.1.150.0080.00818.49
8.1.140.0090.00618.64
8.1.130.0130.00418.60
8.1.120.0110.00518.59
8.1.110.0170.00018.58
8.1.100.0170.00018.70
8.1.90.0160.00018.63
8.1.80.0100.00318.71
8.1.70.0180.00018.61
8.1.60.0120.00318.87
8.1.50.0090.00918.68
8.1.40.0110.00718.88
8.1.30.0140.00618.84
8.1.20.0140.00618.89
8.1.10.0100.00818.61
8.1.00.0150.00418.71
8.0.300.0040.00419.77
8.0.290.0050.00316.63
8.0.280.0130.00418.02
8.0.270.0110.00418.04
8.0.260.0110.00418.06
8.0.250.0080.00818.18
8.0.240.0120.00418.10
8.0.230.0120.00218.18
8.0.220.0120.00317.98
8.0.210.0030.00717.97
8.0.200.0060.00318.06
8.0.190.0080.00318.02
8.0.180.0080.00418.17
8.0.170.0120.00218.10
8.0.160.0140.00018.13
8.0.150.0060.00518.00
8.0.140.0040.00818.07
8.0.130.0110.00418.00
8.0.120.0040.01018.13
8.0.110.0150.00017.92
8.0.100.0140.00218.06
8.0.90.0130.00318.11
8.0.80.0120.00317.95
8.0.70.0150.00018.07
8.0.60.0120.00417.91
8.0.50.0090.00718.06
8.0.30.0080.00818.11
8.0.20.0070.00718.05
8.0.10.0110.00418.10

preferences:
39.67 ms | 403 KiB | 5 Q