3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getRandomStr($length){ return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length); } $start = microtime(true); function put(&$mixed, $key, $value) { if (is_array($mixed)) { $mixed[$key] = $value; } else { // Do something else which we don't care about here } } $mixed = array(); for($i = 0; $i < 10000; $i++) { put($mixed, getRandomStr(15), 'abcd'); } print 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.0110.02116.08
7.3.110.0100.01715.85
7.3.100.0070.02415.84
7.3.90.0060.02215.80
7.3.80.0130.01616.04
7.3.70.0070.02315.95
7.3.60.0060.01916.18
7.3.50.0000.02915.99
7.3.40.0130.01615.91
7.3.30.0030.02015.87
7.3.20.0070.02116.61
7.3.10.0090.02116.58
7.3.00.0050.02616.53
7.2.240.0100.02615.72
7.2.230.0070.02715.88
7.2.220.0130.01916.16
7.2.210.0030.03116.14
7.2.200.0000.03516.09
7.2.190.0060.03115.98
7.2.180.0030.02315.93
7.2.170.0000.02716.16
7.2.160.0100.02315.96
7.2.150.0000.02516.99
7.2.140.0100.02316.72
7.2.130.0090.02416.82
7.2.120.0100.02416.87
7.2.110.0070.02816.73
7.2.100.0050.02816.82
7.2.90.0110.02416.79
7.2.80.0060.02716.76
7.2.70.0040.02816.83
7.2.60.0060.02616.79
7.2.50.0080.02516.79
7.2.40.0060.02916.73
7.2.30.0100.02316.75
7.2.20.0080.03116.70
7.2.10.0080.02916.76
7.2.00.0060.02517.56
7.1.330.0090.02516.05
7.1.320.0040.03615.82
7.1.310.0030.03115.83
7.1.300.0060.02615.85
7.1.290.0000.03615.81
7.1.280.0070.02815.65
7.1.270.0000.03715.83
7.1.260.0000.03715.80
7.1.250.0020.02915.75
7.1.70.0030.02417.08
7.1.60.0130.04919.40
7.1.50.0100.05116.98
7.1.00.0030.05322.46
7.0.200.0060.01216.92
7.0.140.0070.08722.19
7.0.120.0030.08022.06
7.0.80.0070.04320.91
7.0.70.0100.05720.95
7.0.60.0130.08320.91
7.0.50.0100.09021.30
7.0.40.0030.09320.09
7.0.30.0070.10320.02
7.0.20.0070.09320.14
7.0.10.0070.07020.07
7.0.00.0070.09720.12
5.6.280.1902.23723.44
5.6.230.1572.34323.28
5.6.220.2072.20723.24
5.6.210.1502.35023.45
5.6.200.2032.29723.93
5.6.190.1702.33023.83
5.6.180.1872.31323.65
5.6.170.2232.17723.94
5.6.160.1502.35023.71
5.6.150.1602.34023.69
5.6.140.1672.33323.74
5.6.130.1872.31323.78
5.6.120.1902.31023.74
5.6.110.1672.33323.75
5.6.100.2032.17023.83
5.6.90.0102.40723.90
5.6.80.1932.30723.21
5.6.70.1772.32323.16
5.6.60.1502.21723.11
5.6.50.2032.24323.15
5.6.40.1802.32023.41
5.6.30.4932.00723.04
5.6.20.1832.31723.07
5.6.10.1672.33323.32
5.6.00.2172.28323.01
5.5.370.1672.17322.48
5.5.360.1572.22022.36
5.5.350.2302.18723.12
5.5.340.1432.32722.78
5.5.330.1702.26022.80
5.5.320.1972.25722.63
5.5.310.1602.27723.45
5.5.300.1732.27323.09
5.5.290.2072.21323.58
5.5.280.1772.22323.56
5.5.270.1372.30722.89
5.5.260.1502.31022.86
5.5.250.2602.20022.69
5.5.240.1602.29722.14
5.5.230.1932.25022.50
5.5.220.2202.25022.48
5.5.210.2202.22322.25
5.5.200.1872.26322.16
5.5.190.1972.24722.39
5.5.180.1432.32022.20
5.5.160.2172.23723.18
5.5.150.1802.24722.20
5.5.140.1902.25722.04
5.5.130.1472.31022.31
5.5.120.1572.29322.19
5.5.110.1972.25022.15
5.5.100.1702.26322.73
5.5.90.1602.29322.23
5.5.80.1272.30322.17
5.5.70.2032.21721.93
5.5.60.2632.15322.09
5.5.50.1532.26722.72
5.5.40.2102.22722.20
5.5.30.1202.33322.07
5.5.20.1932.25722.06
5.5.10.1732.27022.20
5.5.00.1772.32022.58
5.4.450.2272.15322.09
5.4.440.1672.29321.59
5.4.430.2372.16722.39
5.4.420.2032.24722.32
5.4.410.1802.24322.07
5.4.400.0232.44721.59
5.4.390.2002.25321.12
5.4.380.1972.26721.88
5.4.370.2102.20721.79
5.4.360.1532.24021.76
5.4.350.2032.18321.72
5.4.340.1872.25021.19
5.4.320.1802.23021.24
5.4.310.1802.25721.26
5.4.300.2302.25721.96
5.4.290.2132.23721.43
5.4.280.1702.29021.07
5.4.270.1972.21021.75
5.4.260.2132.18721.89
5.4.250.1732.26721.13
5.4.240.1672.19721.03
5.4.230.2032.24021.37
5.4.220.1772.28321.29
5.4.210.1872.25721.12
5.4.200.2072.22721.38
5.4.190.1702.31721.18
5.4.180.1602.18721.20
5.4.170.1832.27321.88
5.4.160.1602.29021.10
5.4.150.2002.20721.70
5.4.140.1802.25018.61
5.4.130.2272.24019.39
5.4.120.1902.26718.80
5.4.110.1632.09318.41
5.4.100.1571.85718.46
5.4.90.0002.33319.16
5.4.80.0002.37019.15
5.4.70.1832.20019.07
5.4.60.1071.85318.39
5.4.50.2032.23019.00
5.4.40.2072.23718.43
5.4.30.2132.22318.36
5.4.20.2032.16719.12
5.4.10.2202.18719.09
5.4.00.1872.24717.98
5.3.290.1402.32716.61
5.3.280.1602.30316.60
5.3.270.1202.27316.44
5.3.260.2332.23716.75
5.3.250.1872.27016.74
5.3.240.1832.25316.72
5.3.230.1902.26716.71
5.3.220.1732.27316.73
5.3.210.1372.35316.48
5.3.200.0671.96016.42
5.3.190.2072.27717.38
5.3.180.1231.82716.45
5.3.170.1772.28317.38
5.3.160.1932.08016.29
5.3.150.1532.29016.59
5.3.140.1872.28317.49
5.3.130.1402.32716.59
5.3.120.1632.31716.44
5.3.110.1702.25016.38
5.3.100.1532.30316.14
5.3.90.1402.30715.80
5.3.80.1532.29315.89
5.3.70.1532.32716.14
5.3.60.1872.23715.79
5.3.50.0102.25716.95
5.3.40.1602.29715.91
5.3.30.1302.33715.96
5.3.20.0132.44015.73
5.3.10.1402.34015.85
5.3.00.1472.28715.50
5.2.170.3132.11313.04
5.2.160.2832.17013.02
5.2.150.0132.44713.25
5.2.140.2832.13312.86
5.2.130.2902.17312.88
5.2.120.2702.17712.96
5.2.110.2472.18013.02
5.2.100.2031.91312.72
5.2.90.2471.80312.58
5.2.80.2971.73012.84
5.2.70.1671.87712.85
5.2.60.2431.84012.55
5.2.50.1201.92012.55
5.2.40.1431.90712.38
5.2.30.1031.89012.42
5.2.20.1131.91712.31
5.2.10.4931.89712.73
5.2.00.3872.04012.51
5.1.60.0732.34011.82
5.1.50.0872.36011.80
5.1.40.0632.35011.50
5.1.30.0732.34312.07
5.1.20.0332.35311.73
5.1.10.0632.39711.73
5.1.00.1032.36011.94
5.0.50.1132.33710.32
5.0.40.1232.35010.21
5.0.30.0902.35710.04
5.0.20.0872.35310.00
5.0.10.0332.1139.77
5.0.00.0201.8809.73
4.4.90.0101.9307.63
4.4.80.0471.9707.63
4.4.70.0201.9737.63
4.4.60.0131.9677.63
4.4.50.0602.1307.63
4.4.40.0672.3537.63
4.4.30.0772.3377.75
4.4.20.0802.3777.84
4.4.10.0672.4107.79
4.4.00.0602.3877.79
4.3.110.0732.3637.71
4.3.100.0872.3407.68
4.3.90.0702.3777.63
4.3.80.0271.9077.63
4.3.70.0202.0207.63
4.3.60.0331.9837.63
4.3.50.0372.1837.63
4.3.40.0932.3677.63
4.3.30.1072.3637.63
4.3.20.0602.3477.63
4.3.10.0532.4037.63
4.3.00.0832.3807.63

preferences:
36.33 ms | 401 KiB | 5 Q