3v4l.org

run code in 300+ PHP versions simultaneously
<?php $log = array ( array('Red', 'Steel'), array('Red', 'Wood'), array('Blue', 'Wood') ); $materials = array(); $colors = array(); foreach($log as $line) { $colors[$line[0]] = (!isset($colors[$line[0]])) ? 1 : $colors[$line[0]] + 1; $materials[$line[1]] = (!isset($materials[$line[1]])) ? 1 : $materials[$line[1]] + 1; } ?> <h2>Colors</h2>\n <?php foreach ($colors as $color => $amount) echo "{$color} => {$amount}<br>\n"; ?> <h2>Materials</h2>\n <?php foreach ($materials as $material => $amount) echo "{$material} => {$amount}<br>\n"; ?>

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)
8.3.60.0110.00418.30
8.3.50.0120.00522.84
8.3.40.0040.01118.97
8.3.30.0150.00019.27
8.3.20.0090.00020.16
8.3.10.0040.00421.89
8.3.00.0040.00417.78
8.2.180.0140.00716.48
8.2.170.0140.00022.96
8.2.160.0130.00020.50
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0080.00020.92
8.2.110.0090.00020.35
8.2.100.0000.01217.91
8.2.90.0030.00518.22
8.2.80.0040.00417.97
8.2.70.0000.00917.75
8.2.60.0060.00618.05
8.2.50.0080.00018.07
8.2.40.0080.00018.16
8.2.30.0040.00418.12
8.2.20.0040.00417.80
8.2.10.0000.00818.20
8.2.00.0080.00017.66
8.1.280.0070.01125.92
8.1.270.0040.00423.92
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00322.19
8.1.230.0040.00720.89
8.1.220.0000.00817.74
8.1.210.0000.00818.83
8.1.200.0080.00317.48
8.1.190.0090.00017.23
8.1.180.0000.00718.10
8.1.170.0040.00418.59
8.1.160.0070.00022.07
8.1.150.0000.00718.78
8.1.140.0040.00417.32
8.1.130.0030.00317.73
8.1.120.0040.00417.50
8.1.110.0040.00417.36
8.1.100.0000.00717.34
8.1.90.0030.00517.38
8.1.80.0040.00417.49
8.1.70.0080.00017.34
8.1.60.0030.00617.48
8.1.50.0060.00317.52
8.1.40.0060.00317.46
8.1.30.0040.00417.65
8.1.20.0040.00417.66
8.1.10.0050.00217.59
8.1.00.0060.00317.39
8.0.300.0090.00020.16
8.0.290.0030.00516.75
8.0.280.0070.00018.49
8.0.270.0000.00717.13
8.0.260.0070.00017.25
8.0.250.0030.00316.98
8.0.240.0040.00416.84
8.0.230.0070.00016.99
8.0.220.0030.00316.89
8.0.210.0000.00716.80
8.0.200.0030.00316.97
8.0.190.0070.00016.92
8.0.180.0000.00816.87
8.0.170.0000.00816.92
8.0.160.0000.00716.78
8.0.150.0040.00416.91
8.0.140.0040.00716.78
8.0.130.0000.00513.30
8.0.120.0030.00616.88
8.0.110.0000.00816.73
8.0.100.0070.00016.79
8.0.90.0000.00716.75
8.0.80.0120.00916.88
8.0.70.0040.00416.93
8.0.60.0030.00516.70
8.0.50.0000.00716.95
8.0.30.0130.00517.09
8.0.20.0080.01217.40
8.0.10.0000.00716.98
8.0.00.0090.00816.89
7.4.330.0020.00215.05
7.4.320.0030.00316.61
7.4.300.0030.00316.59
7.4.290.0030.00316.60
7.4.280.0030.00416.63
7.4.270.0040.00416.69
7.4.260.0000.00716.50
7.4.250.0000.00716.63
7.4.240.0020.00516.55
7.4.230.0030.00316.59
7.4.220.0100.01416.64
7.4.210.0090.00616.58
7.4.200.0040.00316.59
7.4.160.0090.00616.46
7.4.150.0320.02717.40
7.4.140.0060.01117.86
7.4.130.0100.01016.46
7.4.120.0090.01116.53
7.4.110.0160.00016.68
7.4.100.0060.01516.29
7.4.90.0140.00716.52
7.4.80.0070.01419.39
7.4.70.0060.01216.41
7.4.60.0070.01316.32
7.4.50.0080.00016.53
7.4.40.0060.00916.47
7.4.30.0060.01116.23
7.4.10.0000.01715.05
7.4.00.0050.01215.10
7.3.330.0000.00613.17
7.3.320.0020.00213.17
7.3.310.0030.00516.20
7.3.300.0040.00416.28
7.3.290.0000.01316.32
7.3.280.0080.01016.34
7.3.270.0090.01217.40
7.3.260.0100.01016.47
7.3.240.0030.01516.30
7.3.230.0120.00616.39
7.3.210.0060.01216.34
7.3.200.0090.01219.39
7.3.190.0160.00016.62
7.3.180.0080.00816.41
7.3.170.0060.01016.46
7.3.160.0100.00616.48
7.3.130.0060.01014.81
7.3.120.0100.00714.81
7.3.110.0090.00914.89
7.3.100.0030.00914.93
7.3.90.0030.00614.98
7.3.80.0080.00015.14
7.3.70.0040.01415.03
7.3.60.0060.01014.83
7.3.50.0040.00814.68
7.3.40.0000.01114.54
7.3.30.0030.01014.71
7.3.20.0040.01116.71
7.3.10.0040.00716.49
7.3.00.0040.01116.43
7.2.330.0130.01016.72
7.2.320.0060.01116.51
7.2.310.0100.00616.61
7.2.300.0080.00816.90
7.2.290.0130.00316.79
7.2.260.0080.00815.32
7.2.250.0130.00315.00
7.2.240.0070.00715.35
7.2.230.0080.00815.12
7.2.220.0040.01115.08
7.2.210.0060.00915.05
7.2.200.0110.00714.92
7.2.190.0000.01515.24
7.2.180.0000.01415.18
7.2.170.0090.00615.25
7.2.160.0150.00015.18
7.2.150.0030.00617.06
7.2.140.0070.00717.00
7.2.130.0070.00816.95
7.2.120.0060.00516.95
7.2.110.0050.01016.97
7.2.100.0050.00516.97
7.2.90.0050.00816.71
7.2.80.0080.00517.06
7.2.70.0030.01116.88
7.2.60.0030.00717.08
7.2.50.0080.00517.04
7.2.40.0050.00916.92
7.2.30.0040.00916.87
7.2.20.0070.00716.98
7.2.10.0030.01216.88
7.2.00.0070.00617.79
7.1.330.0070.00715.82
7.1.320.0000.01215.68
7.1.310.0040.01215.71
7.1.300.0030.01215.70
7.1.290.0030.01015.75
7.1.280.0000.01315.98
7.1.270.0030.01015.64
7.1.260.0030.00715.62
7.1.250.0040.00615.78
7.1.240.0060.00615.71
7.1.230.0050.00915.77
7.1.220.0030.00715.56
7.1.210.0050.00615.71
7.1.200.0030.00815.86
7.1.190.0050.00815.83
7.1.180.0020.00815.88
7.1.170.0060.00615.77
7.1.160.0060.00515.87
7.1.150.0080.00515.78
7.1.140.0080.00515.84
7.1.130.0050.00915.73
7.1.120.0050.01015.91
7.1.110.0040.00915.79
7.1.100.0040.00816.70
7.1.90.0020.00815.88
7.1.80.0070.00515.65
7.1.70.0240.00716.26
7.1.60.0050.01116.97
7.1.50.0050.01016.21
7.1.40.0070.00515.78
7.1.30.0030.01115.82
7.1.20.0060.00915.74
7.1.10.0020.00815.67
7.1.00.0070.02818.03
7.0.330.0030.00715.45
7.0.320.0050.01015.37
7.0.310.0020.01015.37
7.0.300.0070.00315.40
7.0.290.0030.00915.26
7.0.280.0050.00815.46
7.0.270.0030.01115.27
7.0.260.0040.00915.39
7.0.250.0030.00615.40
7.0.240.0020.01315.34
7.0.230.0020.01115.45
7.0.220.0040.00715.52
7.0.210.0030.00915.35
7.0.200.0040.00615.87
7.0.190.0050.00715.31
7.0.180.0100.00215.42
7.0.170.0050.00515.24
7.0.160.0050.00515.47
7.0.150.0070.00515.29
7.0.140.0020.02817.59
7.0.130.0060.00415.34
7.0.120.0040.00715.47
7.0.110.0080.00315.55
7.0.100.0030.01015.31
7.0.90.0050.00315.46
7.0.80.0020.00615.24
7.0.70.0050.00715.48
7.0.60.0070.02016.90
7.0.50.0070.03016.19
7.0.40.0060.02815.69
7.0.30.0120.02115.51
7.0.20.0110.03515.73
7.0.10.0030.03415.58
7.0.00.0040.02115.80
5.6.400.0120.00314.14
5.6.390.0120.00614.40
5.6.380.0020.01014.69
5.6.370.0070.00614.76
5.6.360.0050.00914.24
5.6.350.0080.00514.51
5.6.340.0030.00714.44
5.6.330.0060.00814.43
5.6.320.0090.00214.45
5.6.310.0030.00814.50
5.6.300.0050.00714.32
5.6.290.0060.00814.40
5.6.280.0030.03016.76
5.6.270.0020.00914.69
5.6.260.0050.00814.52
5.6.250.0020.01214.61
5.6.240.0060.00414.62
5.6.230.0050.00814.54
5.6.220.0050.00814.48
5.6.210.0030.03616.50
5.6.200.0050.02115.75
5.6.190.0070.02316.38
5.6.180.0190.02616.40
5.6.170.0120.03116.40
5.6.160.0070.02316.42
5.6.150.0080.02515.60
5.6.140.0080.02015.59
5.6.130.0030.03415.60
5.6.120.0050.02916.83
5.6.110.0040.02016.62
5.6.100.0090.02416.87
5.6.90.0040.03316.61
5.6.80.0060.03316.43
5.6.70.0020.01214.12
5.6.60.0020.00714.36
5.6.50.0030.00814.48
5.6.40.0070.00514.47
5.6.30.0030.01114.60
5.6.20.0080.00214.27
5.6.10.0080.00814.27
5.6.00.0080.00814.36
5.5.380.0040.00512.74
5.5.370.0070.00712.81
5.5.360.0070.00512.71
5.5.350.0130.01815.35
5.5.340.0050.01714.56
5.5.330.0020.02115.44
5.5.320.0090.01815.35
5.5.310.0130.01715.14
5.5.300.0040.03214.56
5.5.290.0050.03014.51
5.5.280.0060.03215.44
5.5.270.0070.02915.42
5.5.260.0030.03515.58
5.5.250.0000.02515.40
5.5.240.0040.03015.28
5.5.230.0060.00612.76
5.5.220.0000.01212.73
5.5.210.0030.00812.79
5.5.200.0020.00812.78
5.5.190.0080.00512.76
5.5.180.0000.00812.78
5.5.170.0050.00512.64
5.5.160.0050.00512.75
5.5.150.0040.00912.65
5.5.140.0010.00812.84
5.5.130.0070.00612.55
5.5.120.0050.00912.81
5.5.110.0050.00812.87
5.5.100.0020.00812.81
5.5.90.0050.00312.91
5.5.80.0030.00912.68
5.5.70.0080.00512.93
5.5.60.0050.00712.74
5.5.50.0060.00612.62
5.5.40.0100.00312.59
5.5.30.0060.00812.73
5.5.20.0060.00412.87
5.5.10.0000.01112.60
5.5.00.0020.01112.55
5.4.450.0130.01713.96
5.4.440.0130.02013.92
5.4.430.0250.01813.87
5.4.420.0070.01814.03
5.4.410.0180.01613.90
5.4.400.0100.02213.81
5.4.390.0160.02313.78
5.4.380.0200.02313.68
5.4.370.0140.02713.48
5.4.360.0150.02613.78
5.4.350.0130.02713.51
5.4.340.0140.02313.56
5.4.330.0070.00511.11
5.4.320.0030.01911.62
5.4.310.0050.01811.53
5.4.300.0050.01811.66
5.4.290.0050.01911.68
5.4.280.0040.01811.44
5.4.270.0080.01511.41
5.4.260.0070.01411.64
5.4.250.0030.01911.42
5.4.240.0100.01211.50
5.4.230.0030.01711.58
5.4.220.0040.01811.58
5.4.210.0090.01311.45
5.4.200.0060.02011.38
5.4.190.0070.01711.50
5.4.180.0040.01811.57
5.4.170.0060.01711.53
5.4.160.0070.01611.48
5.4.150.0060.01911.49
5.4.140.0050.01711.45
5.4.130.0050.01711.35
5.4.120.0030.01711.28
5.4.110.0020.01711.42
5.4.100.0040.01911.35
5.4.90.0050.01311.40
5.4.80.0060.01611.31
5.4.70.0030.01711.34
5.4.60.0050.01711.31
5.4.50.0090.01311.45
5.4.40.0030.01611.37
5.4.30.0060.01511.45
5.4.20.0060.01411.31
5.4.10.0030.02211.34
5.4.00.0030.02111.31
5.3.290.0050.01811.40
5.3.280.0060.01911.29
5.3.270.0080.02011.38
5.3.260.0080.01911.37
5.3.250.0040.01911.39
5.3.240.0050.01611.30
5.3.230.0080.01511.28
5.3.220.0070.01511.31
5.3.210.0050.01611.33
5.3.200.0070.01911.31
5.3.190.0080.01311.31
5.3.180.0050.01611.38
5.3.170.0030.01611.36
5.3.160.0090.01711.37
5.3.150.0030.01811.37
5.3.140.0060.01411.40
5.3.130.0020.01811.34
5.3.120.0040.01811.32
5.3.110.0050.01611.37
5.3.100.0030.01711.18
5.3.90.0050.01611.18
5.3.80.0060.01711.04
5.3.70.0070.01511.04
5.3.60.0010.02011.13
5.3.50.0030.01811.06
5.3.40.0060.01811.06
5.3.30.0040.01711.04
5.3.20.0060.01611.03
5.3.10.0050.01610.92
5.3.00.0060.01510.88
5.2.170.0040.0199.44
5.2.160.0070.0159.38
5.2.150.0060.0159.44
5.2.140.0040.0199.40
5.2.130.0040.0189.23
5.2.120.0040.0179.39
5.2.110.0040.0169.22
5.2.100.0050.0169.33
5.2.90.0020.0209.31
5.2.80.0040.0179.25
5.2.70.0020.0189.27
5.2.60.0020.0209.20
5.2.50.0030.0189.20
5.2.40.0040.0189.21
5.2.30.0040.0199.16
5.2.20.0020.0199.17
5.2.10.0040.0209.12
5.2.00.0060.0139.05
5.1.60.0020.0168.69
5.1.50.0060.0128.69
5.1.40.0050.0148.68
5.1.30.0050.0178.86
5.1.20.0060.0148.87
5.1.10.0040.0148.73
5.1.00.0050.0138.73
5.0.50.0050.0097.97
5.0.40.0030.0117.90
5.0.30.0070.0147.81
5.0.20.0040.0117.79
5.0.10.0030.0117.78
5.0.00.0020.0197.78
4.4.90.0040.0077.04
4.4.80.0010.0107.02
4.4.70.0030.0087.02
4.4.60.0040.0077.02
4.4.50.0030.0087.03
4.4.40.0010.0177.00
4.4.30.0040.0127.03
4.4.20.0030.0137.07
4.4.10.0020.0097.07
4.4.00.0010.0167.03
4.3.110.0010.0116.98
4.3.100.0020.0106.98
4.3.90.0010.0116.96
4.3.80.0010.0156.94
4.3.70.0010.0116.96
4.3.60.0020.0106.96
4.3.50.0040.0096.96
4.3.40.0010.0166.91
4.3.30.0010.0116.30
4.3.20.0020.0126.29
4.3.10.0000.0126.27
4.3.00.0030.01212.23

preferences:
37.26 ms | 401 KiB | 5 Q