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', ), ), ), ); 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']; $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.70.0120.00418.28
8.3.60.0110.00416.63
8.3.50.0130.00622.05
8.3.40.0180.00018.59
8.3.30.0130.00318.42
8.3.20.0050.00220.25
8.3.10.0080.00023.61
8.3.00.0080.00019.38
8.2.180.0100.01016.75
8.2.170.0140.00022.96
8.2.160.0030.01022.25
8.2.150.0030.00624.18
8.2.140.0050.00224.66
8.2.130.0000.00726.16
8.2.120.0060.00317.62
8.2.110.0060.00320.39
8.2.100.0040.00717.93
8.2.90.0050.00319.35
8.2.80.0050.00317.97
8.2.70.0030.00617.63
8.2.60.0040.00417.93
8.2.50.0030.00618.07
8.2.40.0000.00719.41
8.2.30.0040.00420.65
8.2.20.0000.00817.84
8.2.10.0080.00018.26
8.2.00.0040.00418.13
8.1.280.0070.01425.92
8.1.270.0000.00823.84
8.1.260.0040.00426.35
8.1.250.0070.00728.09
8.1.240.0060.00322.46
8.1.230.0070.00417.79
8.1.220.0040.00417.78
8.1.210.0070.00318.77
8.1.200.0070.00317.34
8.1.190.0050.00317.35
8.1.180.0000.00918.10
8.1.170.0000.00820.42
8.1.160.0030.00522.04
8.1.150.0000.00718.83
8.1.140.0040.00419.52
8.1.130.0000.00717.61
8.1.120.0040.00417.47
8.1.110.0040.00417.46
8.1.100.0040.00417.52
8.1.90.0040.00417.39
8.1.80.0030.00617.38
8.1.70.0040.00417.41
8.1.60.0000.00917.63
8.1.50.0040.00417.57
8.1.40.0060.00317.45
8.1.30.0040.00417.68
8.1.20.0000.00817.62
8.1.10.0060.00317.63
8.1.00.0040.00417.58
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0030.00518.47
8.0.270.0000.00717.29
8.0.260.0000.00717.25
8.0.250.0020.00517.00
8.0.240.0040.00417.01
8.0.230.0040.00416.85
8.0.220.0030.00416.91
8.0.210.0050.00316.97
8.0.200.0040.00417.00
8.0.190.0000.01016.87
8.0.180.0040.00417.00
8.0.170.0030.00516.90
8.0.160.0000.00816.95
8.0.150.0000.00716.87
8.0.140.0000.00716.77
8.0.130.0030.00313.30
8.0.120.0060.00316.89
8.0.110.0060.00316.96
8.0.100.0040.00416.98
8.0.90.0000.00816.98
8.0.80.0000.01416.86
8.0.70.0000.00716.82
8.0.60.0040.00416.99
8.0.50.0040.00416.87
8.0.30.0050.01717.14
8.0.20.0120.00817.40
8.0.10.0000.00717.04
8.0.00.0120.00716.86
7.4.330.0030.00315.08
7.4.320.0060.00016.62
7.4.300.0030.00316.54
7.4.290.0030.00316.55
7.4.280.0050.00316.66
7.4.270.0030.00316.53
7.4.260.0030.00316.61
7.4.250.0000.00716.45
7.4.240.0020.00516.62
7.4.230.0000.00716.66
7.4.220.0090.01116.39
7.4.210.0090.00516.58
7.4.200.0070.00016.44
7.4.160.0130.00916.64
7.4.150.0120.00617.40
7.4.140.0070.01117.86
7.4.130.0100.00716.52
7.4.120.0070.01116.62
7.4.110.0110.00716.48
7.4.100.0130.00416.41
7.4.90.0100.00716.39
7.4.80.0090.01219.39
7.4.70.0030.01316.54
7.4.60.0100.00616.66
7.4.50.0050.00316.65
7.4.40.0090.01516.48
7.4.30.0070.01016.57
7.4.00.0110.00314.92
7.3.330.0070.00013.38
7.3.320.0030.00313.41
7.3.310.0030.00316.20
7.3.300.0030.00316.43
7.3.290.0000.00716.30
7.3.280.0100.01016.40
7.3.270.0110.00617.40
7.3.260.0060.01316.35
7.3.250.0140.00516.38
7.3.240.0100.00816.52
7.3.230.0110.00716.62
7.3.210.0070.01116.59
7.3.200.0040.01916.50
7.3.190.0090.01016.37
7.3.180.0060.01016.43
7.3.170.0130.00316.45
7.3.160.0130.00716.45
7.3.10.0140.00716.36
7.3.00.0120.00815.98
7.2.330.0080.00916.79
7.2.320.0080.00916.71
7.2.310.0060.01316.67
7.2.300.0040.01316.58
7.2.290.0060.01216.78
7.2.130.0070.01016.62
7.2.120.0130.00716.46
7.2.110.0060.01516.88
7.2.100.0070.01716.60
7.2.90.0170.00816.72
7.2.80.0270.00316.71
7.2.70.0080.01616.73
7.2.60.0200.00816.61
7.2.50.0160.00916.61
7.2.40.0200.00816.76
7.2.30.0210.00316.67
7.2.20.0210.00716.71
7.2.10.0070.01116.50
7.2.00.0090.00718.13
7.1.250.0120.00615.35
7.1.200.0030.00915.91
7.1.100.0070.00718.06
7.1.70.0040.00417.14
7.1.60.0030.01019.43
7.1.50.0130.01016.90
7.1.00.0100.07022.57
7.0.200.0250.00914.73
7.0.60.0370.06719.98
7.0.50.0070.05017.87
7.0.40.0030.04320.21
7.0.30.0100.07320.10
7.0.20.0270.08020.12
7.0.10.0070.04020.12
7.0.00.0100.07320.22
5.6.280.0030.03720.83
5.6.210.0100.08020.54
5.6.200.0070.05018.29
5.6.190.0030.09020.57
5.6.180.0430.05720.60
5.6.170.0370.07020.50
5.6.160.0000.05720.44
5.6.150.0130.06718.29
5.6.140.0100.06318.29
5.6.130.0100.03718.15
5.6.120.0070.05020.91
5.6.110.0030.04021.00
5.6.100.0070.04721.00
5.6.90.0000.08020.99
5.6.80.0070.08720.55
5.5.350.0270.07720.51
5.5.340.0070.08718.03
5.5.330.0130.08020.19
5.5.320.0230.08020.51
5.5.310.0330.06020.27
5.5.300.0130.06717.97
5.5.290.0070.04717.98
5.5.280.0070.05720.70
5.5.270.0070.07320.80
5.5.260.0030.04320.88
5.5.250.0200.06720.56
5.5.240.0100.06320.20
5.4.450.0770.04719.70
5.4.440.0700.06019.57
5.4.430.0730.06719.35
5.4.420.0700.04319.61
5.4.410.0670.05719.48
5.4.400.0730.05019.16
5.4.390.0700.05019.14
5.4.380.0700.05019.37
5.4.370.0600.06019.15
5.4.360.0770.05719.01
5.4.350.0700.05018.87
5.4.340.0500.05719.15
5.4.320.0600.05719.37
5.4.310.0570.05719.14
5.4.300.0570.07019.22
5.4.290.0570.05018.83
5.4.280.0530.05319.15
5.4.270.0770.04019.12
5.4.260.0530.05318.84
5.4.250.0530.05719.25
5.4.240.0530.05319.14
5.4.230.0700.04719.14
5.4.220.0500.06018.86
5.4.210.0670.06018.84
5.4.200.0400.06319.28
5.4.190.0570.05719.28
5.4.180.0530.05318.86
5.4.170.0600.05019.21
5.4.160.0530.05019.25
5.4.150.0570.05319.18
5.4.140.0600.04716.39
5.4.130.0470.05716.32
5.4.120.0570.05316.71
5.4.110.0570.05316.49
5.4.100.0470.05716.56
5.4.90.0600.04716.70
5.4.80.0570.04716.48
5.4.70.0630.04016.65
5.4.60.0500.05316.62
5.4.50.0600.05316.40
5.4.40.0630.04316.59
5.4.30.0630.04016.43
5.4.20.0500.05316.60
5.4.10.0570.04316.51
5.4.00.0600.04015.73

preferences:
59.96 ms | 401 KiB | 5 Q