3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'a' => 0, 'b' => 0, 'c' => 0, 'd' => 1, 'e' => 1, 'f' => 1 ]; $array = [1,0,0,0,0,1,1,0,0,0,0,0,0]; $counters = [0, 0]; $nths = []; foreach ($array as $v) { $nths[] = $counters[$v]++; } array_multisort($nths, $array, SORT_DESC); var_export($array);

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.0120.01016.22
8.5.00.0080.01420.06
8.4.160.0080.01323.73
8.4.150.0020.00114.05
8.4.140.0150.00817.49
8.4.130.0120.00917.39
8.4.120.0060.00224.33
8.4.110.0120.00718.86
8.4.100.0130.00617.68
8.4.90.0110.01017.60
8.4.80.0130.00717.89
8.4.70.0100.01117.89
8.4.60.0090.01217.61
8.4.50.0080.01020.27
8.4.40.0100.01017.48
8.4.30.0350.01417.24
8.4.20.0280.01717.44
8.4.10.0340.00717.19
8.3.280.0070.00318.42
8.3.270.0080.01216.38
8.3.260.0060.00316.86
8.3.250.0120.00818.88
8.3.240.0140.00617.18
8.3.230.0110.00816.54
8.3.220.0110.00819.00
8.3.210.0120.00816.44
8.3.200.0090.01016.95
8.3.190.0110.00817.52
8.3.180.0110.00918.76
8.3.170.0040.00417.29
8.3.160.0360.00816.47
8.3.150.0410.00616.39
8.3.140.0420.00516.68
8.3.130.0340.00616.36
8.3.120.0340.00716.29
8.3.110.0280.00316.29
8.3.100.0190.00816.23
8.3.90.0160.00816.57
8.3.80.0270.01816.32
8.3.70.0410.01116.43
8.3.60.0260.00016.64
8.3.50.0280.00616.50
8.3.40.0310.01417.18
8.3.30.0280.00717.29
8.3.20.0300.00617.47
8.3.10.0250.01117.39
8.3.00.0080.01317.47
8.2.290.0110.00722.41
8.2.280.0100.00916.36
8.2.270.0300.00716.50
8.2.260.0340.00816.46
8.2.250.0370.00016.25
8.2.240.0180.00716.50
8.2.230.0180.00016.61
8.2.220.0320.00416.57
8.2.210.0290.00916.39
8.2.200.0280.01016.39
8.2.190.0240.01416.27
8.2.180.0300.01016.40
8.2.170.0370.00717.43
8.2.160.0380.00317.73
8.2.150.0250.01517.46
8.2.140.0290.01117.44
8.2.130.0300.01017.32
8.2.120.0340.00617.35
8.2.110.0330.00717.62
8.2.100.0350.00417.73
8.2.90.0350.00317.68
8.2.80.0220.01617.67
8.2.70.0310.00617.25
8.2.60.0360.00617.52
8.2.50.0440.01017.29
8.2.40.0230.01717.37
8.2.30.0320.00717.41
8.2.20.0270.01017.55
8.2.10.0280.01117.38
8.2.00.0310.00617.48
8.1.320.0160.00517.85

preferences:
38.91 ms | 403 KiB | 5 Q