3v4l.org

run code in 300+ PHP versions simultaneously
<?php const INT_COUNT = 10000; // Fill an array with random ints $ints = []; for ($i = 0; $i < INT_COUNT; $i++){ $ints[] = rand(0, 255); } // Sort the ints sort($ints); $start = microtime(true); // Do nothing but access each int in the array for ($i = 0; $i < INT_COUNT; $i++){ $ints[$i]; } $finish = microtime(true); printf("Time taken with sort(): %.3f seconds\n", $finish - $start); // Now do it again, but this time use an asort // Fill an array with random ints $ints = []; for ($i = 0; $i < INT_COUNT; $i++){ $ints[] = rand(0, 255); } // asort the ints asort($ints); $start = microtime(true); // Do nothing but access each int in the array for ($i = 0; $i < INT_COUNT; $i++){ $ints[$i]; } $finish = microtime(true); printf("Time taken with asort(): %.3f seconds\n", $finish - $start);

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)
7.2.00.0030.01319.35
7.1.70.0030.00917.13
7.1.60.0100.02519.17
7.1.50.0040.02216.78
7.1.00.0070.07022.37
7.0.200.0030.00816.69
7.0.140.0000.08022.04
7.0.80.0200.07320.59
7.0.70.0230.07020.69
7.0.60.0170.08020.63
7.0.50.0630.07321.03
7.0.40.0200.07019.95
7.0.30.0030.05720.05
7.0.20.0070.08720.18
7.0.10.0030.06320.10
7.0.00.0170.06720.07
5.6.280.0070.08722.39
5.6.230.0130.09721.98
5.6.220.0070.10721.90
5.6.210.0170.08721.95
5.6.200.0130.06722.39
5.6.190.0030.09722.33
5.6.180.0100.10022.36
5.6.170.0200.08722.29
5.6.160.0200.08022.48
5.6.150.0100.05322.43
5.6.140.0070.08722.46
5.6.130.0070.10722.23
5.6.120.0100.09022.38
5.6.110.0170.07322.39
5.6.100.0100.09322.36
5.6.90.0000.11022.36
5.6.80.0030.09021.70
5.6.70.0030.11021.76
5.6.60.0100.09321.62
5.6.50.0170.05021.73
5.6.40.0100.06321.62
5.6.30.0070.06321.83
5.6.20.0170.07721.79
5.6.10.0030.06721.70
5.6.00.0030.06721.72
5.5.370.0070.10721.87
5.5.360.0100.10321.72
5.5.350.0070.11021.67
5.5.340.0070.10322.23
5.5.330.0100.06322.23
5.5.320.0070.08022.20
5.5.310.0100.10322.16
5.5.300.0100.09722.13
5.5.290.0130.09322.13
5.5.280.0030.05721.98
5.5.270.0030.06022.06
5.5.260.0130.09322.18
5.5.250.0030.10322.04
5.5.240.0070.09721.56
5.5.230.0170.09321.48
5.5.220.0070.09721.60
5.5.210.0070.10721.59
5.5.200.0130.09321.48
5.5.190.0030.10721.38
5.5.180.0070.08721.45
5.5.160.0070.10021.51
5.5.150.0070.05321.28
5.5.140.0100.07021.29
5.5.130.0070.09721.41
5.5.120.0070.09321.57
5.5.110.0130.09321.43
5.5.100.0100.08721.38
5.5.90.0100.07721.37
5.5.80.0100.08021.41
5.5.70.0170.09321.39
5.5.60.0170.08021.45
5.5.50.0070.07321.33
5.5.40.0100.10021.54
5.5.30.0070.05021.35
5.5.20.0070.05721.46
5.5.10.0100.04721.33
5.5.00.0030.05321.38
5.4.450.0130.09720.35
5.4.440.0000.06020.51
5.4.430.0070.10020.46
5.4.420.0070.05320.59
5.4.410.0170.07720.32
5.4.400.0000.10720.29
5.4.390.0100.09020.23
5.4.380.0100.08320.22
5.4.370.0100.09320.08
5.4.360.0000.08320.18
5.4.350.0070.09320.28
5.4.340.0170.06320.18
5.4.320.0130.08720.29
5.4.310.0130.09020.32
5.4.300.0000.05720.05
5.4.290.0100.07720.20
5.4.280.0100.07320.13
5.4.270.0100.08720.37
5.4.260.0100.10020.28
5.4.250.0100.07320.16
5.4.240.0100.05720.18
5.4.230.0100.07320.28
5.4.220.0030.10020.01
5.4.210.0100.07720.38
5.4.200.0130.09320.28
5.4.190.0100.06320.25
5.4.180.0070.05020.27
5.4.170.0030.05020.12
5.4.160.0100.05320.26
5.4.150.0030.07320.25
5.4.140.0070.05017.55
5.4.130.0030.04717.56
5.4.120.0030.04717.44
5.4.110.0030.05017.58
5.4.100.0030.04317.68
5.4.90.0000.05317.44
5.4.80.0000.05317.52
5.4.70.0000.05717.48
5.4.60.0000.05317.66
5.4.50.0030.08017.52
5.4.40.0070.05717.61
5.4.30.0100.08317.57
5.4.20.0000.05017.46
5.4.10.0030.09717.48
5.4.00.0030.05316.79
5.3.290.0030.08014.50
5.3.280.0100.07714.54
5.3.270.0070.03314.46
5.3.260.0100.05314.60
5.3.250.0100.06014.57
5.3.240.0000.04014.54
5.3.230.0030.03714.56
5.3.220.0070.03714.55
5.3.210.0000.04014.42
5.3.200.0000.03714.43
5.3.190.0000.04014.53
5.3.180.0000.04014.52
5.3.170.0000.04014.45
5.3.160.0000.03314.39
5.3.150.0070.04314.43
5.3.140.0030.04714.49
5.3.130.0000.04014.40
5.3.120.0030.04014.48
5.3.110.0000.04014.41
5.3.100.0070.05313.90
5.3.90.0100.04714.02
5.3.80.0200.06013.96
5.3.70.0000.05314.00
5.3.60.0070.04013.76
5.3.50.0070.03013.95
5.3.40.0030.03013.91
5.3.30.0000.03713.87
5.3.20.0030.05013.70
5.3.10.0000.04713.64
5.3.00.0070.05713.61
5.2.170.0070.04311.77
5.2.160.0000.03311.77
5.2.150.0030.02311.77
5.2.140.0000.03311.77
5.2.130.0070.02311.77
5.2.120.0030.02711.77
5.2.110.0000.03711.77
5.2.100.0030.03311.77
5.2.90.0000.03011.77
5.2.80.0000.03011.77
5.2.70.0070.04711.77
5.2.60.0100.02011.77
5.2.50.0030.02711.77
5.2.40.0030.04311.77
5.2.30.0000.02711.77
5.2.20.0000.04711.77
5.2.10.0030.04311.77
5.2.00.0000.06011.77
5.1.60.0070.02011.77
5.1.50.0030.02311.77
5.1.40.0000.02711.77
5.1.30.0000.02711.77
5.1.20.0000.02711.77
5.1.10.0000.02711.77
5.1.00.0030.02311.77
5.0.50.0000.02711.77
5.0.40.0070.03711.77
5.0.30.0030.06011.77
5.0.20.0070.04011.77
5.0.10.0070.03711.77
5.0.00.0000.04711.77
4.4.90.0000.02311.77
4.4.80.0030.01711.77
4.4.70.0070.00711.77
4.4.60.0030.02711.77
4.4.50.0030.01311.77
4.4.40.0000.02711.77
4.4.30.0000.02711.77
4.4.20.0000.01711.77
4.4.10.0000.01711.77
4.4.00.0000.05011.77
4.3.110.0030.01711.77
4.3.100.0070.03011.77
4.3.90.0030.02011.77
4.3.80.0030.03311.77
4.3.70.0000.02311.77
4.3.60.0030.02711.77
4.3.50.0000.03711.77
4.3.40.0000.05311.77
4.3.30.0000.03711.77
4.3.20.0000.02311.77
4.3.10.0000.04011.77
4.3.00.0000.03711.77

preferences:
46.88 ms | 401 KiB | 5 Q