3v4l.org

run code in 300+ PHP versions simultaneously
<?php $memory1 = memory_get_usage(true); print 'before: ' . $memory1 ."\n"; $keys = array(); for ($i = 0; $i<1000; $i++) { $keys[] = 'pref:keyname:' . rand(1000000, 9999999); } asort($keys); $memory2 = memory_get_usage(true); print 'after: ' . $memory2 ."\n"; print 'allocated: ' . ($memory2 - $memory1);

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.4.10.0070.01316.73
7.4.00.0130.00016.47
7.3.130.0060.01216.50
7.3.120.0150.00316.35
7.3.110.0090.00616.30
7.3.100.0060.01316.29
7.3.90.0030.01016.44
7.3.80.0120.00316.43
7.3.70.0070.00316.52
7.3.60.0030.00916.32
7.3.50.0070.00716.38
7.3.40.0000.01316.34
7.3.30.0060.01016.50
7.3.20.0070.01018.14
7.3.10.0100.00618.05
7.3.00.0030.01618.05
7.2.260.0070.01416.91
7.2.250.0070.01416.57
7.2.240.0030.01416.63
7.2.230.0100.01016.63
7.2.220.0070.01016.63
7.2.210.0070.00416.87
7.2.200.0100.00316.68
7.2.190.0030.01316.63
7.2.180.0060.00316.60
7.2.170.0130.00016.62
7.2.160.0030.00716.77
7.2.150.0000.02018.28
7.2.140.0120.00618.54
7.2.130.0070.00718.43
7.2.120.0060.01218.48
7.2.110.0100.00718.37
7.2.100.0070.01018.43
7.2.90.0030.00918.33
7.2.80.0070.01018.38
7.2.70.0080.01118.61
7.2.60.0060.00918.39
7.2.50.0000.01518.23
7.2.40.0030.01218.27
7.2.30.0120.00618.50
7.2.20.0070.01018.52
7.2.10.0080.00418.36
7.2.00.0110.00718.66
7.1.330.0070.01017.49
7.1.320.0090.00317.16
7.1.310.0030.01217.46
7.1.300.0070.00417.11
7.1.290.0070.00317.41
7.1.280.0000.01417.42
7.1.270.0080.00617.34
7.1.260.0030.01517.32
7.1.250.0040.01117.42
7.1.240.0040.00817.34
7.1.230.0040.01517.25
7.1.220.0000.01217.26
7.1.210.0070.00317.30
7.1.200.0040.01517.39
7.1.190.0040.01417.31
7.1.180.0110.00017.26
7.1.170.0100.00717.23
7.1.160.0110.00717.18
7.1.150.0100.00717.22
7.1.140.0070.00717.31
7.1.130.0070.01017.29
7.1.120.0000.01517.12
7.1.110.0040.01117.34
7.1.100.0070.01017.06
7.1.90.0030.00717.32
7.1.80.0070.00317.40
7.1.70.0050.01217.19
7.1.60.0110.00918.42
7.1.50.0090.00717.05
7.1.40.0000.01317.27
7.1.30.0100.00717.19
7.1.20.0030.01017.55
7.1.10.0090.00617.46
7.1.00.0050.02719.86
7.0.330.0040.01117.06
7.0.320.0060.00317.02
7.0.310.0070.01117.09
7.0.300.0060.00916.91
7.0.290.0000.01116.95
7.0.280.0030.01017.11
7.0.270.0030.01617.02
7.0.260.0080.00817.04
7.0.250.0030.01016.84
7.0.240.0090.00617.10
7.0.230.0040.00817.08
7.0.220.0060.01217.07
7.0.210.0030.01317.15
7.0.200.0050.00516.86
7.0.190.0070.00717.09
7.0.180.0000.01317.16
7.0.170.0040.01417.05
7.0.160.0000.01017.18
7.0.150.0090.00617.06
7.0.140.0070.04019.51
7.0.130.0070.01116.88
7.0.120.0110.00717.14
7.0.110.0120.00617.00
7.0.100.0060.00917.02
7.0.90.0130.00317.10
7.0.80.0090.00617.19
7.0.70.0050.00516.92
7.0.60.0100.04218.48
7.0.50.0020.04117.41
7.0.40.0070.02717.51
7.0.30.0150.04217.67
7.0.20.0080.02817.54
7.0.10.0140.02717.62
7.0.00.0050.02517.51
5.6.400.0070.01816.18
5.6.390.0070.00716.17
5.6.380.0030.01216.02
5.6.370.0120.00616.13
5.6.360.0060.01315.79
5.6.350.0070.01116.18
5.6.340.0140.00415.98
5.6.330.0070.01016.07
5.6.320.0140.00316.07
5.6.310.0060.00916.14
5.6.300.0100.00715.85
5.6.290.0000.01516.05
5.6.280.0050.04518.56
5.6.270.0000.01915.78
5.6.260.0030.01216.24
5.6.250.0040.01215.97
5.6.240.0060.00916.10
5.6.230.0030.01615.99
5.6.220.0120.00815.95
5.6.210.0050.03918.44
5.6.200.0080.04617.12
5.6.190.0030.02518.20
5.6.180.0150.03018.22
5.6.170.0260.03918.18
5.6.160.0050.03818.12
5.6.150.0080.03817.10
5.6.140.0070.02917.05
5.6.130.0060.05017.14
5.6.120.0080.04718.62
5.6.110.0080.05018.50
5.6.100.0030.02518.54
5.6.90.0070.04218.42
5.6.80.0070.04418.16
5.6.70.0220.03918.11
5.6.60.0000.01415.90
5.6.50.0070.01316.08
5.6.40.0070.01116.06
5.6.30.0070.00715.90
5.6.20.0060.01215.97
5.6.10.0030.01015.83
5.6.00.0040.00715.90
5.5.380.0060.01216.05
5.5.370.0070.00716.07
5.5.360.0030.01016.06
5.5.350.0100.02118.24
5.5.340.0060.02917.03
5.5.330.0070.04018.13
5.5.320.0130.02618.13
5.5.310.0130.04318.08
5.5.300.0040.04917.03
5.5.290.0100.04317.03
5.5.280.0040.05118.41
5.5.270.0110.02018.43
5.5.260.0110.04618.44
5.5.250.0100.04618.18
5.5.240.0110.04118.05
5.5.230.0060.00615.86
5.5.220.0070.01015.93
5.5.210.0000.01715.89
5.5.200.0000.01716.07
5.5.190.0080.00415.93
5.5.180.0030.00915.96
5.5.170.0030.01015.72
5.5.160.0070.01116.00
5.5.150.0000.01515.78
5.5.140.0070.01015.96
5.5.130.0030.01215.77
5.5.120.0070.00715.93
5.5.110.0040.01515.73
5.5.100.0060.00615.76
5.5.90.0070.00316.05
5.5.80.0040.01215.67
5.5.70.0000.01415.86
5.5.60.0030.01315.94
5.5.50.0080.00615.90
5.5.40.0050.00515.81
5.5.30.0040.01415.91
5.5.20.0080.00715.64
5.5.10.0090.00915.75
5.5.00.0030.01315.65
5.4.450.0390.03016.13
5.4.440.0580.03416.05
5.4.430.0620.03816.21
5.4.420.0520.03616.15
5.4.410.0480.02516.04
5.4.400.0370.03515.80
5.4.390.0270.03815.71
5.4.380.0180.02915.79
5.4.370.0050.04115.61
5.4.360.0130.02515.75
5.4.350.0070.02412.45
5.4.340.0060.02412.33
5.4.330.0000.01312.54
5.4.320.0050.02512.67
5.4.310.0050.02312.66
5.4.300.0060.02112.64
5.4.290.0050.02312.65
5.4.280.0050.02212.64
5.4.270.0040.02312.64
5.4.260.0040.02312.51
5.4.250.0030.03615.67
5.4.240.0100.03915.68
5.4.230.0100.03115.78
5.4.220.0130.02815.67
5.4.210.0100.04115.77
5.4.200.0030.03515.81
5.4.190.0090.03815.80
5.4.180.0050.03415.87
5.4.170.0090.03115.71
5.4.160.0060.04515.60
5.4.150.0080.02715.81
5.4.140.0020.04414.51
5.4.130.0080.03714.47
5.4.120.0020.03514.48
5.4.110.0030.04514.54
5.4.100.0050.03314.47
5.4.90.0070.03614.49
5.4.80.0050.03014.61
5.4.70.0080.02614.36
5.4.60.0080.02814.54
5.4.50.0170.02014.50
5.4.40.0090.02614.58
5.4.30.0030.03214.51
5.4.20.0110.03314.62
5.4.10.0050.03114.55
5.4.00.0060.02814.17
5.3.290.0050.02613.15
5.3.280.0020.03513.96
5.3.270.0070.03313.98
5.3.260.0080.04513.89
5.3.250.0080.03813.94
5.3.240.0110.03814.02
5.3.230.0070.03713.82
5.3.220.0050.03213.81
5.3.210.0050.04213.86
5.3.200.0020.04613.93
5.3.190.0100.02813.79
5.3.180.0100.03014.04
5.3.170.0030.04213.93
5.3.160.0060.03414.04
5.3.150.0080.02813.95
5.3.140.0030.03713.95
5.3.130.0020.04714.09
5.3.120.0070.04713.91
5.3.110.0000.03613.84
5.3.100.0070.03913.49
5.3.90.0100.03413.63
5.3.80.0080.03313.50
5.3.70.0050.03313.63
5.3.60.0010.03913.55
5.3.50.0040.03013.62
5.3.40.0080.02913.48
5.3.30.0100.03113.74
5.3.20.0150.02213.49
5.3.10.0050.03113.29
5.3.00.0090.03813.31
5.2.170.0000.05011.34
5.2.160.0000.04711.32
5.2.150.0100.05311.25
5.2.140.0070.06011.15
5.2.130.0100.03711.27
5.2.120.0030.06011.21
5.2.110.0070.05311.29
5.2.100.0100.04311.19
5.2.90.0000.06311.21
5.2.80.0100.04711.27
5.2.70.0070.04711.18
5.2.60.0100.04011.24
5.2.50.0100.06011.21
5.2.40.0030.04011.21
5.2.30.0130.03711.17
5.2.20.0130.03711.15
5.2.10.0100.03711.25
5.2.00.0030.04010.80
5.1.60.0070.03010.09
5.1.50.0130.0239.77
5.1.40.0100.02710.01
5.1.30.0100.05010.23
5.1.20.0100.03310.43
5.1.10.0070.03310.26
5.1.00.0030.0379.83
5.0.50.0070.0238.77
5.0.40.0000.0308.13
5.0.30.0030.0438.36
5.0.20.0030.0308.10
5.0.10.0000.0308.21
5.0.00.0070.0408.07
4.4.90.0130.0207.38
4.4.80.0030.0207.38
4.4.70.0030.0307.38
4.4.60.0000.0277.38
4.4.50.0100.0207.38
4.4.40.0000.0377.38
4.4.30.0000.0207.38
4.4.20.0030.0337.38
4.4.10.0070.0177.38
4.4.00.0030.0337.38
4.3.110.0000.0237.38
4.3.100.0030.0207.38
4.3.90.0000.0237.38
4.3.80.0000.0377.38
4.3.70.0070.0207.38
4.3.60.0030.0207.38
4.3.50.0030.0207.38
4.3.40.0070.0377.38
4.3.30.0070.0177.38
4.3.20.0000.0337.38
4.3.10.0000.0237.38
4.3.00.0230.0175.83

preferences:
43.73 ms | 400 KiB | 5 Q