3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRandomStr($length){ return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length); } $start = microtime(true); // Mixed could theoretically be an object or an array. // In this example it's an array. $mixed = array(); for($i = 0; $i < 10000; $i++) { if (is_array($mixed)) { $mixed[getRandomStr(15)] = 'abcd'; } else { // Do something else which we don't care about here } } print count($mixed) . ' items, ' . round(microtime(true) - $start, 2) . 's';

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.3.120.0030.02516.03
7.3.110.0030.02516.13
7.3.100.0100.02015.82
7.3.90.0070.02316.07
7.3.80.0040.02515.71
7.3.70.0100.01715.82
7.3.60.0060.02515.76
7.3.50.0070.02415.89
7.3.40.0030.02315.70
7.3.30.0040.01815.81
7.3.20.0030.03316.59
7.3.10.0060.02216.64
7.3.00.0130.01616.41
7.2.240.0100.01915.71
7.2.230.0030.02416.12
7.2.220.0060.02216.00
7.2.210.0070.02716.25
7.2.200.0000.03216.01
7.2.190.0030.03015.78
7.2.180.0000.03015.95
7.2.170.0000.02515.88
7.2.160.0070.02015.85
7.2.150.0070.02416.91
7.2.140.0130.01917.01
7.2.130.0030.03016.87
7.2.120.0130.01616.95
7.2.110.0070.02316.81
7.2.100.0070.02016.96
7.2.90.0060.02316.99
7.2.80.0060.02216.79
7.2.70.0130.01716.97
7.2.60.0070.02416.80
7.2.50.0100.02017.00
7.2.40.0130.01916.57
7.2.30.0070.02417.10
7.2.20.0100.02016.68
7.2.10.0030.02416.83
7.2.00.0050.02718.15
7.1.330.0070.03015.59
7.1.320.0070.03015.65
7.1.310.0000.03815.86
7.1.300.0070.03615.57
7.1.290.0030.04515.66
7.1.280.0060.02915.43
7.1.270.0060.03215.60
7.1.260.0030.03715.64
7.1.250.0070.02715.64
7.1.70.0040.02517.09
7.1.60.0160.04519.27
7.1.50.0030.05316.67
7.1.00.0030.10722.25
7.0.200.0160.01016.62
7.0.140.0030.09022.04
7.0.80.0070.05021.07
7.0.70.0070.05320.86
7.0.60.0200.03320.80
7.0.50.0000.05021.13
7.0.40.0070.06020.07
7.0.30.0070.04020.11
7.0.20.0070.04719.95
7.0.10.0030.04320.10
7.0.00.0030.07320.10
5.6.280.0070.09022.61
5.6.230.0070.05022.22
5.6.220.0070.07322.16
5.6.210.0100.04722.20
5.6.200.0030.05322.58
5.6.190.0070.05022.66
5.6.180.0130.04722.57
5.6.170.0070.04722.59
5.6.160.0100.09022.71
5.6.150.0100.05022.65
5.6.140.0070.05722.50
5.6.130.0070.09322.71
5.6.120.0200.08722.46
5.6.110.0070.10722.71
5.6.100.0100.05322.56
5.6.90.0070.10022.61
5.6.80.0130.10721.87
5.6.70.0030.07021.94
5.6.60.0100.06321.98
5.6.50.0130.08721.89
5.6.40.0030.07721.95
5.6.30.0100.04721.93
5.6.20.0070.05321.86
5.6.10.0100.09322.01
5.6.00.0070.08021.90
5.5.370.0070.05022.00
5.5.360.0070.05721.92
5.5.350.0070.08321.97
5.5.340.0030.07722.19
5.5.330.0070.05022.35
5.5.320.0000.05722.28
5.5.310.0030.05322.46
5.5.300.0070.07722.18
5.5.290.0130.10022.43
5.5.280.0100.06022.30
5.5.270.0230.08322.37
5.5.260.0070.10322.29
5.5.250.0130.08022.15
5.5.240.0100.07021.79
5.5.230.0130.05021.73
5.5.220.0100.09321.79
5.5.210.0130.09021.82
5.5.200.0030.07021.79
5.5.190.0070.08321.76
5.5.180.0030.08721.72
5.5.160.0030.05721.73
5.5.150.0100.06021.69
5.5.140.0100.05021.82
5.5.130.0130.10021.65
5.5.120.0130.05321.69
5.5.110.0130.09021.68
5.5.100.0170.09021.61
5.5.90.0100.10321.55
5.5.80.0070.05021.52
5.5.70.0130.07321.69
5.5.60.0170.08321.66
5.5.50.0030.05721.70
5.5.40.0170.05021.60
5.5.30.0130.05021.50
5.5.20.0070.06021.60
5.5.10.0130.09021.51
5.5.00.0030.08021.63
5.4.450.0070.08720.83
5.4.440.0030.05720.89
5.4.430.0100.07020.81
5.4.420.0070.08320.90
5.4.410.0100.04720.52
5.4.400.0100.08320.59
5.4.390.0070.05020.52
5.4.380.0030.05020.34
5.4.370.0100.07320.51
5.4.360.0070.07320.47
5.4.350.0030.05320.59
5.4.340.0070.05320.58
5.4.320.0070.05020.53
5.4.310.0100.05320.56
5.4.300.0130.08720.56
5.4.290.0130.09020.54
5.4.280.0100.05320.50
5.4.270.0100.08720.59
5.4.260.0030.05720.61
5.4.250.0070.08320.32
5.4.240.0000.05320.52
5.4.230.0170.06020.58
5.4.220.0030.05320.42
5.4.210.0100.04720.50
5.4.200.0100.09720.57
5.4.190.0070.05720.57
5.4.180.0100.04320.57
5.4.170.0000.05320.50
5.4.160.0070.09320.37
5.4.150.0030.09720.41
5.4.140.0170.08717.89
5.4.130.0100.04717.71
5.4.120.0100.09317.97
5.4.110.0070.05017.80
5.4.100.0100.05317.88
5.4.90.0030.04717.99
5.4.80.0070.05317.86
5.4.70.0100.10317.82
5.4.60.0100.09017.95
5.4.50.0030.09717.93
5.4.40.0070.09717.75
5.4.30.0100.05017.78
5.4.20.0030.05317.92
5.4.10.0070.04717.80
5.4.00.0030.05317.26
5.3.290.0100.09316.38
5.3.280.0070.05016.30
5.3.270.0130.07316.31
5.3.260.0070.09316.43
5.3.250.0230.05716.34
5.3.240.0130.06716.41
5.3.230.0030.05316.27
5.3.220.0000.06016.41
5.3.210.0170.07016.30
5.3.200.0000.07716.36
5.3.190.0170.08716.38
5.3.180.0100.09316.40
5.3.170.0000.06316.26
5.3.160.0030.09316.40
5.3.150.0070.06016.25
5.3.140.0070.05716.55
5.3.130.0000.07016.28
5.3.120.0100.09016.39
5.3.110.0070.09316.34
5.3.100.0070.05315.73
5.3.90.0130.09715.86
5.3.80.0130.09315.69
5.3.70.0070.07315.82
5.3.60.0000.08715.63
5.3.50.0070.07315.68
5.3.40.0130.09315.71
5.3.30.0170.08315.63
5.3.20.0170.05015.32
5.3.10.0030.05715.27
5.3.00.0070.09015.37
5.2.170.0100.07312.84
5.2.160.0070.04312.71
5.2.150.0100.08012.64
5.2.140.0000.09312.60
5.2.130.0070.08312.52
5.2.120.0100.04712.73
5.2.110.0070.07012.67
5.2.100.0070.06012.59
5.2.90.0030.09012.52
5.2.80.0030.06012.76
5.2.70.0000.06712.79
5.2.60.0100.03712.69
5.2.50.0000.04712.59
5.2.40.0070.04312.55
5.2.30.0100.07012.59
5.2.20.0000.05712.59
5.2.10.0030.07312.36
5.2.00.0000.05012.32
5.1.60.0030.03712.36
5.1.50.0070.04712.45
5.1.40.0070.07712.51
5.1.30.0030.04712.79
5.1.20.0030.08012.70
5.1.10.0070.04312.44
5.1.00.0000.05712.47
5.0.50.0030.03711.69
5.0.40.0030.04011.69
5.0.30.0030.08311.69
5.0.20.0030.07311.69
5.0.10.0070.05011.69
5.0.00.0070.06011.69
4.4.90.0000.03311.69
4.4.80.0000.03311.69
4.4.70.0000.04311.69
4.4.60.0030.04011.69
4.4.50.0070.06311.69
4.4.40.0000.05011.69
4.4.30.0030.06311.69
4.4.20.0100.04711.69
4.4.10.0000.04011.69
4.4.00.0030.04711.69
4.3.110.0030.04011.69
4.3.100.0100.05311.69
4.3.90.0000.06311.69
4.3.80.0000.08311.69
4.3.70.0000.03711.69
4.3.60.0100.03011.69
4.3.50.0000.05011.69
4.3.40.0000.08011.69
4.3.30.0030.03711.69
4.3.20.0070.05711.69
4.3.10.0030.04711.69
4.3.00.0000.03711.69

preferences:
36.56 ms | 400 KiB | 5 Q