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.0090.00616.63
8.3.50.0120.00921.93
8.3.40.0150.00318.79
8.3.30.0040.01118.79
8.3.20.0040.00420.16
8.3.10.0000.00823.70
8.3.00.0030.00619.25
8.2.180.0090.00618.16
8.2.170.0100.01022.96
8.2.160.0140.00022.26
8.2.150.0100.00024.18
8.2.140.0020.00524.66
8.2.130.0080.00026.16
8.2.120.0040.00817.75
8.2.110.0080.00322.19
8.2.100.0040.00717.93
8.2.90.0040.00419.17
8.2.80.0040.00417.97
8.2.70.0030.00517.75
8.2.60.0000.00817.93
8.2.50.0030.00618.07
8.2.40.0040.00419.28
8.2.30.0080.00020.53
8.2.20.0000.00817.79
8.2.10.0000.00718.02
8.2.00.0040.00418.05
8.1.280.0130.00625.92
8.1.270.0080.00023.80
8.1.260.0040.01126.35
8.1.250.0040.00428.09
8.1.240.0030.00622.54
8.1.230.0060.00617.77
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0030.00717.48
8.1.190.0050.00317.25
8.1.180.0050.00318.10
8.1.170.0000.00818.64
8.1.160.0000.00722.05
8.1.150.0040.00418.88
8.1.140.0050.00319.47
8.1.130.0050.00217.46
8.1.120.0040.00417.56
8.1.110.0030.00617.43
8.1.100.0000.00717.52
8.1.90.0000.00717.48
8.1.80.0040.00417.32
8.1.70.0000.00717.46
8.1.60.0060.00317.54
8.1.50.0060.00317.58
8.1.40.0030.00517.59
8.1.30.0030.00517.63
8.1.20.0090.00017.56
8.1.10.0000.00817.62
8.1.00.0060.00317.50
8.0.300.0000.00818.77
8.0.290.0000.00716.75
8.0.280.0000.00718.47
8.0.270.0070.00017.29
8.0.260.0000.00716.79
8.0.250.0000.00717.00
8.0.240.0060.00316.88
8.0.230.0070.00017.00
8.0.220.0030.00316.86
8.0.210.0030.00416.91
8.0.200.0030.00317.00
8.0.190.0000.00816.98
8.0.180.0040.00416.83
8.0.170.0080.00016.81
8.0.160.0030.00516.91
8.0.150.0000.00816.76
8.0.140.0070.00016.76
8.0.130.0000.00613.36
8.0.120.0080.00016.88
8.0.110.0040.00416.86
8.0.100.0040.00416.91
8.0.90.0080.00016.93
8.0.80.0030.01316.90
8.0.70.0020.00516.82
8.0.60.0000.00716.70
8.0.50.0050.00216.74
8.0.30.0140.00617.06
8.0.20.0090.01117.41
8.0.10.0070.00016.87
8.0.00.0100.00816.80
7.4.330.0060.00015.09
7.4.320.0030.00316.44
7.4.300.0000.00616.63
7.4.290.0070.00016.65
7.4.280.0080.00016.52
7.4.270.0000.00616.55
7.4.260.0000.00716.57
7.4.250.0000.00816.54
7.4.240.0030.00416.54
7.4.230.0040.00416.37
7.4.220.0110.01116.65
7.4.210.0060.00816.63
7.4.200.0050.00216.43
7.4.160.0160.00016.61
7.4.150.0100.00917.40
7.4.140.0120.00717.86
7.4.130.0120.01216.44
7.4.120.0090.01016.53
7.4.110.0090.00916.65
7.4.100.0120.00616.49
7.4.90.0030.01616.52
7.4.80.0110.00819.39
7.4.70.0080.00816.52
7.4.60.0100.01316.42
7.4.50.0000.00816.63
7.4.40.0000.02316.51
7.4.30.0140.00316.78
7.4.00.0070.01014.94
7.3.330.0070.00013.41
7.3.320.0000.00613.39
7.3.310.0000.00716.50
7.3.300.0030.00316.45
7.3.290.0030.00316.36
7.3.280.0090.00916.41
7.3.270.0120.00617.40
7.3.260.0110.00616.44
7.3.250.0100.00916.34
7.3.240.0090.01116.36
7.3.230.0030.01516.60
7.3.210.0060.01516.40
7.3.200.0040.01816.55
7.3.190.0140.00616.45
7.3.180.0070.01016.58
7.3.170.0120.00916.59
7.3.160.0070.01016.40
7.2.330.0030.01616.79
7.2.320.0040.01416.51
7.2.310.0030.01516.71
7.2.300.0140.00716.50
7.2.290.0090.00916.70
7.2.60.0120.00316.71
7.2.00.0000.00918.93
7.1.200.0000.01315.85
7.1.100.0110.01118.05
7.1.70.0090.00017.29
7.1.60.0080.00519.43
7.1.50.0040.01816.79
7.1.00.0000.07722.57
7.0.200.0480.00714.69
7.0.60.0100.08020.12
7.0.50.0030.06717.74
7.0.40.0130.03320.23
7.0.30.0100.08020.33
7.0.20.0300.07020.07
7.0.10.0000.04720.17
7.0.00.0070.08720.25
5.6.280.0030.05020.95
5.6.210.0070.04020.65
5.6.200.0130.05018.20
5.6.190.0100.08320.67
5.6.180.0300.03720.77
5.6.170.0330.07720.71
5.6.160.0030.07720.52
5.6.150.0030.06018.18
5.6.140.0070.04318.18
5.6.130.0000.08018.15
5.6.120.0070.08021.16
5.6.110.0030.08721.00
5.6.100.0170.07321.00
5.6.90.0070.04720.98
5.6.80.0030.05720.31
5.5.350.0400.07320.43
5.5.340.0030.05717.98
5.5.330.0100.04020.44
5.5.320.0200.08320.33
5.5.310.0230.05320.19
5.5.300.0130.07317.99
5.5.290.0100.04718.08
5.5.280.0030.04321.00
5.5.270.0070.08320.91
5.5.260.0070.04720.79
5.5.250.0070.08720.49
5.5.240.0000.08020.21
5.4.450.0500.06019.59
5.4.440.0530.06019.47
5.4.430.0470.07019.16
5.4.420.0600.05719.59
5.4.410.0500.06319.07
5.4.400.0500.05719.27
5.4.390.0670.04319.26
5.4.380.0570.05018.84
5.4.370.0500.05319.01
5.4.360.0570.05318.98
5.4.350.0570.05019.26
5.4.340.0530.05318.87
5.4.320.0570.05019.06
5.4.310.0730.05719.26
5.4.300.0570.06019.30
5.4.290.0630.05319.25
5.4.280.0600.05719.25
5.4.270.0500.05719.12
5.4.260.0500.05319.13
5.4.250.0730.06719.30
5.4.240.0630.04719.16
5.4.230.0500.05719.32
5.4.220.0670.06019.16
5.4.210.0700.04719.15
5.4.200.0630.05318.86
5.4.190.0670.04319.14
5.4.180.0600.04719.21
5.4.170.0630.04719.05
5.4.160.0570.05019.15
5.4.150.0570.05318.82
5.4.140.0500.05316.45
5.4.130.0530.05316.31
5.4.120.0530.04716.55
5.4.110.0770.07316.60
5.4.100.0670.04716.24
5.4.90.0600.05016.63
5.4.80.0530.04716.68
5.4.70.0570.04716.68
5.4.60.0500.05316.63
5.4.50.0530.05316.25
5.4.40.0500.05016.61
5.4.30.0630.04716.21
5.4.20.0770.03716.27
5.4.10.0730.06016.44
5.4.00.0670.04315.84

preferences:
69.88 ms | 401 KiB | 5 Q