3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = array_merge(range(0, 100), array()); shuffle($array); const LOOPS = 1000; $b = hrtime(true); for ($i = 0; $i < LOOPS; ++$i) { $c = $array; $c = array_unique($c); } $e = hrtime(true); print number_format( ($e - $b) / 1_000_000, 2). " ms\n"; $b = hrtime(true); for ($i = 0; $i < LOOPS; ++$i) { $c = $array; $d = array_keys(array_count_values($c)); } $e = hrtime(true); print number_format(($e - $b) / 1_000_000, 2). " ms\n";

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.0050.00917.55
8.5.50.0130.00918.32
8.5.40.0180.00716.59
8.5.30.0160.00916.64
8.5.20.0130.01218.46
8.5.10.0160.00516.41
8.5.00.0070.00916.50
8.4.210.0070.00819.10
8.4.200.0180.00820.93
8.4.190.0150.01121.14
8.4.180.0170.00719.39
8.4.170.0170.01119.36
8.4.160.0130.01019.34
8.4.150.0160.00819.50
8.4.140.0150.00917.70
8.4.130.0180.01017.49
8.4.120.0140.01017.47
8.4.110.0130.01417.50
8.4.100.0160.00917.66
8.4.90.0160.01217.76
8.4.80.0170.00717.67
8.4.70.0190.00717.69
8.4.60.0170.01117.69
8.4.50.0140.01117.63
8.4.40.0160.01017.40
8.4.30.0190.00517.48
8.4.20.0150.01317.72
8.4.10.0180.00717.62
8.3.310.0150.01118.36
8.3.300.0140.01218.30
8.3.290.0140.00918.18
8.3.280.0140.01018.17
8.3.270.0140.00718.21
8.3.260.0150.00716.65
8.3.250.0190.01016.59
8.3.240.0170.01118.34
8.3.230.0150.01216.51
8.3.220.0170.01016.53
8.3.210.0160.01016.58
8.3.200.0190.00816.45
8.3.190.0170.00816.52
8.3.180.0180.00918.18
8.3.170.0180.00918.18
8.3.160.0150.00816.57
8.3.150.0160.01116.48
8.3.140.0160.01218.36
8.3.130.0170.00516.79
8.3.120.0120.01216.59
8.3.110.0150.00816.46
8.3.100.0160.01016.66
8.3.90.0180.00718.55
8.3.80.0150.01018.22
8.3.70.0110.01116.66
8.3.60.0170.00716.67
8.3.50.0140.01216.46
8.3.40.0160.01017.82
8.3.30.0120.01119.50
8.3.20.0120.01117.90
8.3.10.0110.01217.80
8.3.00.0140.01017.82
8.2.310.0130.01017.80

preferences:
29.27 ms | 734 KiB | 5 Q