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 < 100; $i++) { if (is_array($mixed)) { $mixed[getRandomStr(15)] = 'abcd'; } else { // Do something else which we don't care about here } } 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.4.10.0090.00915.95
7.4.00.0100.00815.97
7.3.130.0070.01015.94
7.3.120.0080.01015.98
7.3.110.0060.01215.89
7.3.100.0050.01015.99
7.3.90.0060.01115.80
7.3.80.0090.00315.84
7.3.70.0070.00515.85
7.3.60.0040.01015.91
7.3.50.0070.00715.87
7.3.40.0070.00615.90
7.3.30.0060.00815.88
7.3.20.0050.00917.73
7.3.10.0050.00917.61
7.3.00.0030.00917.37
7.2.260.0030.01216.16
7.2.250.0070.01216.05
7.2.240.0070.00816.08
7.2.230.0060.00916.10
7.2.220.0090.00816.09
7.2.210.0060.00916.11
7.2.200.0050.01116.20
7.2.190.0030.01216.13
7.2.180.0090.00615.98
7.2.170.0020.01316.04
7.2.160.0060.01016.01
7.2.150.0050.01017.97
7.2.140.0090.00517.91
7.2.130.0070.00917.59
7.2.120.0080.00617.61
7.2.110.0030.01117.63
7.2.100.0070.00917.72
7.2.90.0060.00617.67
7.2.80.0090.00517.65
7.2.70.0050.00817.72
7.2.60.0010.01317.69
7.2.50.0060.00817.65
7.2.40.0040.00917.67
7.2.30.0060.00817.67
7.2.20.0040.01117.70
7.2.10.0050.01017.66
7.2.00.0070.00917.55
7.1.330.0080.00716.89
7.1.320.0090.00516.90
7.1.310.0050.00916.87
7.1.300.0060.01016.75
7.1.290.0050.00516.88
7.1.280.0070.00616.97
7.1.270.0040.00916.82
7.1.260.0020.01216.77
7.1.250.0060.00816.51
7.1.240.0030.00716.47
7.1.230.0060.00516.56
7.1.220.0070.00716.67
7.1.210.0030.01016.55
7.1.200.0040.00816.51
7.1.190.0080.00616.54
7.1.180.0040.01116.59
7.1.170.0050.00916.57
7.1.160.0050.00916.45
7.1.150.0050.00916.65
7.1.140.0070.00516.54
7.1.130.0050.00916.56
7.1.120.0030.01016.56
7.1.110.0050.00916.59
7.1.100.0050.00716.51
7.1.90.0030.00916.53
7.1.80.0060.00916.60
7.1.70.0060.00816.75
7.1.60.0110.00517.31
7.1.50.0100.00816.70
7.1.40.0070.00716.54
7.1.30.0060.00916.53
7.1.20.0020.01116.53
7.1.10.0050.01016.54
7.1.00.0070.02117.77
7.0.330.0040.00816.23
7.0.320.0060.00916.20
7.0.310.0040.01116.20
7.0.300.0030.01116.17
7.0.290.0070.00916.12
7.0.280.0020.01116.24
7.0.270.0080.00616.05
7.0.260.0080.00516.09
7.0.250.0070.00716.21
7.0.240.0040.00516.15
7.0.230.0090.00716.23
7.0.220.0040.00916.16
7.0.210.0040.00816.20
7.0.200.0050.00916.29
7.0.190.0070.00816.18
7.0.180.0040.00816.09
7.0.170.0050.00616.22
7.0.160.0060.00516.14
7.0.150.0070.00816.04
7.0.140.0030.02417.30
7.0.130.0050.00816.21
7.0.120.0050.00816.23
7.0.110.0040.00616.10
7.0.100.0060.00716.19
7.0.90.0060.00916.12
7.0.80.0060.00716.15
7.0.70.0060.00616.11
7.0.60.0040.01417.00
7.0.50.0040.02416.47
7.0.40.0050.01515.41
7.0.30.0070.01315.40
7.0.20.0080.02415.41
7.0.10.0060.02215.45
7.0.00.0030.01915.39
5.6.400.0050.00615.54
5.6.390.0050.00815.52
5.6.380.0060.00815.26
5.6.370.0040.00915.02
5.6.360.0050.00815.26
5.6.350.0060.00815.19
5.6.340.0080.00815.12
5.6.330.0060.00915.07
5.6.320.0090.00515.26
5.6.310.0060.01015.13
5.6.300.0040.00915.11
5.6.290.0060.00715.17
5.6.280.0040.02316.49
5.6.270.0080.00615.24
5.6.260.0070.00515.23
5.6.250.0060.00815.25
5.6.240.0050.00815.17
5.6.230.0060.01115.11
5.6.220.0070.00715.22
5.6.210.0060.02016.31
5.6.200.0080.01415.73
5.6.190.0050.01916.22
5.6.180.0110.01116.24
5.6.170.0100.02116.27
5.6.160.0030.02016.27
5.6.150.0050.02015.76
5.6.140.0090.01915.66
5.6.130.0060.02515.81
5.6.120.0030.02016.25
5.6.110.0070.02416.39
5.6.100.0060.02416.30
5.6.90.0070.01416.41
5.6.80.0070.02116.09
5.6.70.0070.00815.30
5.6.60.0080.00615.25
5.6.50.0060.00715.15
5.6.40.0030.01015.08
5.6.30.0060.00915.10
5.6.20.0060.00915.11
5.6.10.0060.00615.13
5.6.00.0040.00815.16
5.5.380.0060.00814.45
5.5.370.0050.00814.27
5.5.360.0050.00714.38
5.5.350.0950.01515.61
5.5.340.0050.01815.04
5.5.330.0050.02215.62
5.5.320.0130.02115.58
5.5.310.0100.01715.63
5.5.300.0090.02115.17
5.5.290.0090.01815.03
5.5.280.0050.01915.65
5.5.270.0090.02115.70
5.5.260.0040.01515.63
5.5.250.0060.01515.63
5.5.240.0130.01715.45
5.5.230.0060.00614.33
5.5.220.0040.00914.30
5.5.210.0050.00714.24
5.5.200.0040.01014.37
5.5.190.0050.00714.29
5.5.180.0050.00714.40
5.5.170.0040.00914.21
5.5.160.0040.01014.35
5.5.150.0050.00614.23
5.5.140.0060.00614.35
5.5.130.0030.01014.35
5.5.120.0050.00714.38
5.5.110.0030.01014.31
5.5.100.0040.00914.31
5.5.90.0080.00414.29
5.5.80.0060.00814.27
5.5.70.0040.00914.27
5.5.60.0050.00914.30
5.5.50.0060.01014.30
5.5.40.0040.00914.21
5.5.30.0060.00714.18
5.5.20.0060.00814.33
5.5.10.0020.01214.30
5.5.00.0040.01114.38
5.4.450.0060.01413.45
5.4.440.0080.02013.42
5.4.430.0080.01313.55
5.4.420.0050.01313.40
5.4.410.0070.01913.51
5.4.400.0050.02013.32
5.4.390.0060.01413.38
5.4.380.0060.01913.31
5.4.370.0060.01213.40
5.4.360.0050.02113.27
5.4.350.0100.01713.36
5.4.340.0040.01513.48
5.4.330.0040.00911.93
5.4.320.0070.01513.44
5.4.310.0100.01113.26
5.4.300.0080.01313.37
5.4.290.0070.02013.28
5.4.280.0060.01613.35
5.4.270.0100.01013.37
5.4.260.0040.01913.46
5.4.250.0050.01313.25
5.4.240.0070.01413.43
5.4.230.0060.01513.41
5.4.220.0060.01313.44
5.4.210.0060.01713.40
5.4.200.0100.01013.44
5.4.190.0070.01913.44
5.4.180.0070.01513.27
5.4.170.0080.02013.32
5.4.160.0060.02013.34
5.4.150.0080.01313.39
5.4.140.0050.02012.97
5.4.130.0060.02012.90
5.4.120.0040.02312.88
5.4.110.0070.01412.98
5.4.100.0060.01112.94
5.4.90.0050.01412.91
5.4.80.0060.02012.84
5.4.70.0070.02012.86
5.4.60.0050.01912.79
5.4.50.0060.01712.92
5.4.40.0070.01612.86
5.4.30.0040.01412.91
5.4.20.0060.01212.81
5.4.10.0060.02112.89
5.4.00.0050.01512.76
5.3.290.0080.01612.49
5.3.280.0080.01612.45
5.3.270.0070.01312.52
5.3.260.0060.01412.45
5.3.250.0060.01812.52
5.3.240.0040.01712.42
5.3.230.0070.01412.41
5.3.220.0070.01812.44
5.3.210.0030.01712.47
5.3.200.0050.02012.44
5.3.190.0090.01512.49
5.3.180.0060.01812.46
5.3.170.0060.01312.58
5.3.160.0080.01112.54
5.3.150.0060.01112.53
5.3.140.0070.01312.51
5.3.130.0090.01212.54
5.3.120.0080.02012.46
5.3.110.0050.02212.50
5.3.100.0050.01612.53
5.3.90.0050.01612.35
5.3.80.0080.01412.28
5.3.70.0070.01712.34
5.3.60.0070.01812.31
5.3.50.0060.01612.34
5.3.40.0080.01512.30
5.3.30.0050.01312.30
5.3.20.0080.01312.33
5.3.10.0060.01312.24
5.3.00.0060.01612.19
5.2.170.0110.03112.42
5.2.160.0080.02812.42
5.2.150.0080.01712.42
5.2.140.0080.02112.42
5.2.130.0080.01712.42
5.2.120.0050.03012.42
5.2.110.0080.02512.42
5.2.100.0070.03212.42
5.2.90.0060.01612.42
5.2.80.0070.03212.42
5.2.70.0060.03612.42
5.2.60.0100.02412.42
5.2.50.0110.03212.42
5.2.40.0020.03012.42
5.2.30.0070.03112.42
5.2.20.0120.02612.42
5.2.10.0140.02512.42
5.2.00.0050.02812.42
5.1.60.0050.02112.42
5.1.50.0030.01912.42
5.1.40.0090.02412.42
5.1.30.0100.03012.42
5.1.20.0060.01412.42
5.1.10.0060.01912.42
5.1.00.0060.02812.42
5.0.50.0040.02112.42
5.0.40.0030.02312.42
5.0.30.0060.03012.42
5.0.20.0010.02012.42
5.0.10.0050.02012.42
5.0.00.0060.02612.42
4.4.90.0020.02112.42
4.4.80.0030.00812.42
4.4.70.0070.01212.42
4.4.60.0050.01212.42
4.4.50.0060.01012.42
4.4.40.0010.01612.42
4.4.30.0020.01112.42
4.4.20.0020.02112.42
4.4.10.0030.01812.42
4.4.00.0020.01512.42
4.3.110.0000.01312.42
4.3.100.0050.01112.42
4.3.90.0020.01312.42
4.3.80.0020.01312.42
4.3.70.0030.00812.42
4.3.60.0060.01712.42
4.3.50.0030.01812.42
4.3.40.0040.02212.42
4.3.30.0080.01512.42
4.3.20.0040.01712.42
4.3.10.0000.01612.42
4.3.00.0030.01512.42

preferences:
39.28 ms | 401 KiB | 5 Q