3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( '#attached' => array ( 'library' => array ( 0 => 'system/base', 1 => 'classy/base', 2 => 'core/normalize', ), 'html_head_link' => array ( 0 => array ( 0 => array ( 'rel' => 'shortcut icon', 'href' => 'http://127.0.0.1/core/misc/favicon.ico', 'type' => 'image/vnd.microsoft.icon', ), ), ), 'html_head' => array ( 0 => array ( 0 => array ( '#tag' => 'meta', '#attributes' => array ( 'charset' => 'utf-8', ), '#weight' => -1000, ), 1 => 'system_meta_content_type', ), 1 => array ( 0 => array ( '#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array ( 'name' => 'Generator', 'content' => 'Drupal 8 (https://www.drupal.org)', ), ), 1 => 'system_meta_generator', ), 2 => array ( 0 => array ( '#tag' => 'meta', '#attributes' => array ( 'name' => 'MobileOptimized', 'content' => 'width', ), ), 1 => 'MobileOptimized', ), 3 => array ( 0 => array ( '#tag' => 'meta', '#attributes' => array ( 'name' => 'HandheldFriendly', 'content' => 'true', ), ), 1 => 'HandheldFriendly', ), 4 => array ( 0 => array ( '#tag' => 'meta', '#attributes' => array ( 'name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0', ), ), 1 => 'viewport', ), ), ), ); $merge = array ( 'html_head' => array ( 0 => array ( 0 => array ( '#tag' => 'link', '#attributes' => array ( 'rel' => 'shortcut icon', 'href' => 'http://127.0.0.1/core/misc/favicon.ico', 'type' => 'image/vnd.microsoft.icon', ), ), 1 => 'html_head_link:shortcut icon:http://127.0.0.1/core/misc/favicon.ico', ), ) ); function system_module_test_page_attachments_alter(&$page) { // Remove the HTML5 mobile meta-tags. $meta_tags_to_remove = ['MobileOptimized', 'HandheldFriendly', 'viewport', 'cleartype']; foreach ($page['#attached']['html_head'] as $index => $parts) { if (in_array($parts[1], $meta_tags_to_remove)) { unset($page['#attached']['html_head'][$index]); } } } function processHtmlHead(array $html_head) { $head = []; foreach ($html_head as $index => $item) { list($data, $key) = $item; if (!isset($data['#type'])) { $data['#type'] = 'html_tag'; } $head[$key] = $data; } return $head; } system_module_test_page_attachments_alter($array); $attached = $array['#attached']; $attached = array_merge_recursive($attached, $merge); $head = processHtmlHead($attached['html_head']); print_r($head);

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.00416.75
8.3.50.0080.01022.17
8.3.40.0150.00318.60
8.3.30.0070.00718.89
8.3.20.0040.00420.34
8.3.10.0000.00723.47
8.3.00.0090.00019.25
8.2.180.0120.00418.29
8.2.170.0190.00322.96
8.2.160.0070.00722.25
8.2.150.0030.00724.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0060.00617.75
8.2.110.0060.00320.32
8.2.100.0110.00018.03
8.2.90.0080.00019.41
8.2.80.0000.00817.97
8.2.70.0060.00317.50
8.2.60.0040.00418.03
8.2.50.0030.00618.07
8.2.40.0000.00719.46
8.2.30.0000.00820.66
8.2.20.0000.00817.77
8.2.10.0040.00418.02
8.2.00.0070.00018.10
8.1.280.0110.00725.92
8.1.270.0060.00324.01
8.1.260.0120.00326.35
8.1.250.0070.00028.09
8.1.240.0100.00022.46
8.1.230.0040.00817.77
8.1.220.0000.00817.74
8.1.210.0090.00318.77
8.1.200.0060.00317.35
8.1.190.0000.00817.36
8.1.180.0000.00718.10
8.1.170.0000.00818.49
8.1.160.0020.00522.04
8.1.150.0000.00718.83
8.1.140.0000.00819.61
8.1.130.0000.00717.69
8.1.120.0040.00417.50
8.1.110.0030.00517.52
8.1.100.0000.00817.47
8.1.90.0000.00817.39
8.1.80.0000.00917.47
8.1.70.0070.00017.48
8.1.60.0030.00617.66
8.1.50.0000.00917.56
8.1.40.0090.00017.53
8.1.30.0040.00417.55
8.1.20.0000.00817.56
8.1.10.0040.00417.55
8.1.00.0000.00917.49
8.0.300.0040.00418.77
8.0.290.0060.00316.63
8.0.280.0050.00318.32
8.0.270.0040.00417.28
8.0.260.0040.00417.32
8.0.250.0000.00816.89
8.0.240.0030.00517.00
8.0.230.0000.00816.88
8.0.220.0040.00416.92
8.0.210.0000.00716.92
8.0.200.0000.00616.97
8.0.190.0050.00516.98
8.0.180.0040.00416.84
8.0.170.0070.00016.94
8.0.160.0000.00816.82
8.0.150.0030.00316.80
8.0.140.0040.00416.88
8.0.130.0000.00613.37
8.0.120.0040.00416.84
8.0.110.0000.00816.92
8.0.100.0040.00416.74
8.0.90.0000.00816.70
8.0.80.0090.00616.96
8.0.70.0040.00417.05
8.0.60.0000.00816.82
8.0.50.0000.00716.83
8.0.30.0070.01417.18
8.0.20.0060.01317.40
8.0.10.0040.00417.07
8.0.00.0120.00716.86
7.4.330.0000.00615.10
7.4.320.0040.00416.61
7.4.300.0030.00316.52
7.4.290.0080.00016.43
7.4.280.0060.00316.52
7.4.270.0070.00016.52
7.4.260.0030.00316.47
7.4.250.0080.00016.45
7.4.240.0020.00516.47
7.4.230.0070.00016.73
7.4.220.0090.00916.66
7.4.210.0120.00316.68
7.4.200.0000.00816.43
7.4.160.0080.00816.64
7.4.150.0100.01017.40
7.4.140.0080.01217.86
7.4.130.0130.00716.44
7.4.120.0060.01116.60
7.4.110.0070.01016.46
7.4.100.0070.01716.69
7.4.90.0160.00616.47
7.4.80.0130.01019.39
7.4.70.0100.00716.42
7.4.60.0060.01016.39
7.4.50.0000.00516.40
7.4.40.0090.00916.47
7.4.30.0070.01116.47
7.4.10.0110.00714.81
7.4.00.0050.01214.92
7.3.330.0000.00613.26
7.3.320.0000.00513.32
7.3.310.0000.00716.42
7.3.300.0040.00416.28
7.3.290.0030.00316.39
7.3.280.0060.00916.36
7.3.270.0060.01117.40
7.3.260.0110.00516.66
7.3.240.0060.01116.39
7.3.230.0090.01516.43
7.3.210.0060.01216.43
7.3.200.0080.01516.31
7.3.190.0030.01416.59
7.3.180.0130.00316.50
7.3.170.0070.01416.50
7.3.160.0150.00616.60
7.3.130.0070.01014.72
7.3.120.0120.00514.98
7.3.110.0090.00714.79
7.3.100.0090.00914.82
7.3.90.0070.00914.72
7.3.80.0040.00614.87
7.3.70.0040.01015.01
7.3.60.0120.00514.85
7.3.50.0080.00614.87
7.3.40.0070.00714.70
7.3.30.0030.01014.82
7.3.20.0060.00816.49
7.3.10.0080.00516.54
7.3.00.0070.00816.67
7.2.330.0130.00716.82
7.2.320.0080.01116.85
7.2.310.0030.01516.54
7.2.300.0070.01116.52
7.2.290.0140.00816.92
7.2.260.0170.00015.11
7.2.250.0070.01115.12
7.2.240.0050.00915.04
7.2.230.0080.00815.10
7.2.220.0040.00915.12
7.2.210.0050.00714.96
7.2.200.0070.00715.13
7.2.190.0030.01314.93
7.2.180.0030.01414.93
7.2.170.0080.00815.17
7.2.160.0070.01015.11
7.2.150.0050.00816.91
7.2.140.0050.00516.81
7.2.130.0060.01016.99
7.2.120.0040.01317.01
7.2.110.0100.00316.87
7.2.100.0070.00616.81
7.2.90.0050.01017.06
7.2.80.0040.00816.92
7.2.70.0090.00516.86
7.2.60.0060.00717.02
7.2.50.0070.00316.96
7.2.40.0020.01116.94
7.2.30.0070.00716.94
7.2.20.0030.01017.03
7.2.10.0080.00817.01
7.2.00.0020.00817.70
7.1.330.0070.00915.78
7.1.320.0070.00915.89
7.1.310.0040.00615.91
7.1.300.0040.00715.82
7.1.290.0070.00915.74
7.1.280.0050.00715.91
7.1.270.0030.01315.60
7.1.260.0020.00915.93
7.1.250.0080.00715.85
7.1.240.0030.01015.88
7.1.230.0060.00615.70
7.1.220.0050.00715.58
7.1.210.0050.00815.88
7.1.200.0080.00615.63
7.1.190.0040.00815.67
7.1.180.0090.00615.86
7.1.170.0070.00715.84
7.1.160.0050.00715.91
7.1.150.0060.00515.73
7.1.140.0060.00415.92
7.1.130.0040.01015.78
7.1.120.0020.01115.78
7.1.110.0030.00915.83
7.1.100.0020.00916.56
7.1.90.0090.00615.93
7.1.80.0080.00715.81
7.1.70.0050.00616.25
7.1.60.0050.01317.06
7.1.50.0020.01216.20
7.1.40.0030.01015.84
7.1.30.0020.01215.76
7.1.20.0000.01315.70
7.1.10.0040.01115.81
7.1.00.0060.03018.01
7.0.330.0090.00515.30
7.0.320.0060.00715.46
7.0.310.0050.00815.41
7.0.300.0030.00715.49
7.0.290.0030.01215.44
7.0.280.0070.00615.41
7.0.270.0030.01315.27
7.0.260.0050.00815.34
7.0.250.0040.00415.45
7.0.240.0050.01115.49
7.0.230.0030.01115.42
7.0.220.0110.00315.40
7.0.210.0070.00315.29
7.0.200.0150.01015.19
7.0.190.0090.00715.53
7.0.180.0050.00615.42
7.0.170.0040.00615.28
7.0.160.0030.01015.38
7.0.150.0070.00915.51
7.0.140.0030.00715.45
7.0.130.0050.00615.50
7.0.120.0010.01315.45
7.0.110.0050.00815.27
7.0.100.0090.00415.48
7.0.90.0030.01215.33
7.0.80.0040.00915.34
7.0.70.0030.01015.29
7.0.60.0070.03116.81
7.0.50.0060.02516.24
7.0.40.0060.01815.85
7.0.30.0020.03615.72
7.0.20.0120.03315.83
7.0.10.0090.01615.77
7.0.00.0120.03015.77
5.6.400.0020.00914.49
5.6.390.0020.01014.38
5.6.380.0080.00514.81
5.6.370.0020.00814.66
5.6.360.0090.00614.53
5.6.350.0050.00714.49
5.6.340.0030.00814.38
5.6.330.0030.01014.54
5.6.320.0070.00714.45
5.6.310.0050.01014.42
5.6.300.0040.00714.36
5.6.290.0050.00914.36
5.6.280.0040.02416.91
5.6.270.0060.00914.60
5.6.260.0070.00714.23
5.6.250.0080.00714.55
5.6.240.0040.00914.34
5.6.230.0060.00814.32
5.6.220.0050.00614.59
5.6.210.0050.01716.50
5.6.200.0090.02015.66
5.6.190.0080.02716.38
5.6.180.0150.01716.41
5.6.170.0130.01816.39
5.6.160.0050.03116.47
5.6.150.0050.03315.90
5.6.140.0100.02315.71
5.6.130.0070.03415.74
5.6.120.0060.03416.55
5.6.110.0090.03016.58
5.6.100.0090.03116.58
5.6.90.0050.03416.61
5.6.80.0080.02816.42
5.6.70.0020.01114.50
5.6.60.0070.00814.49
5.6.50.0090.00814.32
5.6.40.0060.00614.29
5.6.30.0080.00714.49
5.6.20.0080.00514.52
5.6.10.0030.01014.64
5.6.00.0050.00914.43
5.5.380.0050.00814.49
5.5.370.0060.00714.60
5.5.360.0070.00814.22
5.5.350.0190.02216.43
5.5.340.0070.03115.56
5.5.330.0070.02716.32
5.5.320.0090.02016.38
5.5.310.0140.02916.29
5.5.300.0070.03215.70
5.5.290.0040.02915.70
5.5.280.0060.02316.71
5.5.270.0070.03016.51
5.5.260.0100.01816.47
5.5.250.0090.02316.43
5.5.240.0070.03216.25
5.5.230.0070.00814.25
5.5.220.0030.00814.27
5.5.210.0110.00214.26
5.5.200.0060.00614.26
5.5.190.0070.00814.28
5.5.180.0110.00314.33
5.5.170.0070.00514.47
5.5.160.0080.00314.24
5.5.150.0110.00314.04
5.5.140.0070.00714.47
5.5.130.0080.00314.32
5.5.120.0080.00314.33
5.5.110.0050.00814.27
5.5.100.0080.00614.32
5.5.90.0060.00614.20
5.5.80.0100.00314.45
5.5.70.0060.01014.39
5.5.60.0080.00614.29
5.5.50.0080.00814.35
5.5.40.0110.00814.17
5.5.30.0080.00514.05
5.5.20.0050.00914.37
5.5.10.0070.01014.24
5.5.00.0050.00914.32
5.4.450.0130.01715.18
5.4.440.0090.02215.16
5.4.430.0130.01815.09
5.4.420.0120.02215.15
5.4.410.0040.02515.18
5.4.400.0090.02015.16
5.4.390.0060.02315.05
5.4.380.0130.01714.99
5.4.370.0120.01815.09
5.4.360.0060.02715.13
5.4.350.0090.02615.14
5.4.340.0050.02315.09
5.4.330.0030.00613.05
5.4.320.0070.02115.12
5.4.310.0100.01815.13
5.4.300.0080.02315.13
5.4.290.0080.02415.08
5.4.280.0080.02515.14
5.4.270.0090.02115.12
5.4.260.0070.02115.05
5.4.250.0050.02315.13
5.4.240.0090.02215.08
5.4.230.0060.02414.99
5.4.220.0090.02415.13
5.4.210.0120.01915.13
5.4.200.0070.02214.99
5.4.190.0110.02015.02
5.4.180.0080.02115.12
5.4.170.0120.01914.99
5.4.160.0100.01915.10
5.4.150.0100.02815.06
5.4.140.0070.02714.21
5.4.130.0100.02114.22
5.4.120.0120.02614.17
5.4.110.0060.02314.14
5.4.100.0070.02014.14
5.4.90.0100.02014.24
5.4.80.0090.02114.11
5.4.70.0080.02214.27
5.4.60.0100.02014.17
5.4.50.0070.02014.22
5.4.40.0070.02314.24
5.4.30.0100.01914.24
5.4.20.0080.02214.24
5.4.10.0080.01914.24
5.4.00.0050.02313.98

preferences:
70.46 ms | 401 KiB | 5 Q