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 merge_it() { return 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_it()); $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.00318.55
8.3.60.0150.00016.50
8.3.50.0090.01022.05
8.3.40.0090.00618.67
8.3.30.0110.00418.67
8.3.20.0000.00720.21
8.3.10.0050.00323.56
8.3.00.0080.00019.38
8.2.190.0030.01216.58
8.2.180.0110.00416.75
8.2.170.0170.00322.96
8.2.160.0100.00322.04
8.2.150.0030.00724.18
8.2.140.0000.00824.66
8.2.130.0040.00726.16
8.2.120.0180.00020.79
8.2.110.0060.00321.00
8.2.100.0120.00017.75
8.2.90.0060.00319.41
8.2.80.0030.00517.97
8.2.70.0000.00917.63
8.2.60.0000.01017.78
8.2.50.0050.00518.10
8.2.40.0080.00020.39
8.2.30.0040.00420.53
8.2.20.0030.00517.71
8.2.10.0050.00318.13
8.2.00.0000.00718.07
8.1.280.0110.00725.92
8.1.270.0080.00023.78
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0090.00023.98
8.1.230.0080.00417.61
8.1.220.0040.00417.79
8.1.210.0000.01018.77
8.1.200.0090.00017.35
8.1.190.0040.00417.63
8.1.180.0030.00618.10
8.1.170.0060.00318.52
8.1.160.0000.00722.14
8.1.150.0040.00418.96
8.1.140.0040.00419.60
8.1.130.0070.00017.75
8.1.120.0040.00417.50
8.1.110.0090.00017.50
8.1.100.0070.00017.37
8.1.90.0000.00717.53
8.1.80.0040.00417.53
8.1.70.0000.00717.38
8.1.60.0030.00517.51
8.1.50.0040.00417.47
8.1.40.0060.00317.47
8.1.30.0030.00517.66
8.1.20.0000.00917.55
8.1.10.0030.00617.58
8.1.00.0000.00817.53
8.0.300.0000.00818.77
8.0.290.0000.00816.75
8.0.280.0000.00718.38
8.0.270.0070.00017.30
8.0.260.0040.00417.34
8.0.250.0070.00016.85
8.0.240.0000.00816.88
8.0.230.0000.00716.95
8.0.220.0040.00416.94
8.0.210.0040.00416.98
8.0.200.0050.00217.00
8.0.190.0000.00816.85
8.0.180.0030.00516.96
8.0.170.0000.00717.01
8.0.160.0000.00716.97
8.0.150.0030.00316.77
8.0.140.0040.00416.91
8.0.130.0030.00313.43
8.0.120.0040.00416.91
8.0.110.0050.00316.90
8.0.100.0040.00416.79
8.0.90.0040.00416.75
8.0.80.0030.01216.89
8.0.70.0050.00316.81
8.0.60.0000.00816.97
8.0.50.0050.00216.91
8.0.30.0120.00617.27
8.0.20.0170.00417.40
8.0.10.0050.00216.84
8.0.00.0060.01216.79
7.4.330.0030.00315.08
7.4.320.0000.00716.61
7.4.300.0000.00616.45
7.4.290.0000.00616.63
7.4.280.0070.00016.42
7.4.270.0030.00316.62
7.4.260.0030.00316.51
7.4.250.0030.00516.57
7.4.240.0050.00216.63
7.4.230.0000.00716.37
7.4.220.0100.01116.70
7.4.210.0120.00516.54
7.4.200.0030.00316.63
7.4.160.0040.01216.41
7.4.150.0030.01417.40
7.4.140.0060.01317.86
7.4.130.0080.01016.50
7.4.120.0100.00716.65
7.4.110.0050.01316.58
7.4.100.0070.01116.59
7.4.90.0070.01416.43
7.4.80.0140.00319.39
7.4.70.0090.00616.48
7.4.60.0130.00316.43
7.4.50.0000.00816.48
7.4.40.0060.01516.57
7.4.30.0050.01116.45
7.4.00.0050.01014.86
7.3.330.0000.00513.34
7.3.320.0050.00013.39
7.3.310.0000.00716.45
7.3.300.0070.00016.30
7.3.290.0070.00016.25
7.3.280.0090.00516.39
7.3.270.0110.01117.40
7.3.260.0120.00416.45
7.3.250.0080.01016.49
7.3.240.0160.00616.51
7.3.230.0070.01116.60
7.3.210.0030.01316.56
7.3.200.0070.01016.59
7.3.190.0010.00116.45
7.3.180.0040.01116.51
7.3.170.0060.01016.36
7.3.160.0130.00616.39
7.3.120.0160.00314.90
7.3.110.0030.01415.14
7.3.100.0060.00915.04
7.3.90.0100.00314.85
7.3.80.0040.01215.04
7.3.70.0100.00014.71
7.3.60.0140.00014.79
7.3.50.0080.00414.83
7.3.40.0040.01114.90
7.3.30.0030.01014.98
7.3.20.0060.00316.38
7.3.10.0000.01316.50
7.3.00.0100.00616.68
7.2.330.0030.01316.88
7.2.320.0100.01016.59
7.2.310.0170.00016.90
7.2.300.0100.00616.89
7.2.290.0120.01316.84
7.2.250.0190.00415.25
7.2.240.0030.01715.37
7.2.230.0060.01215.29
7.2.220.0060.00615.20
7.2.210.0000.01814.91
7.2.200.0070.01015.22
7.2.190.0040.01215.19
7.2.180.0070.00715.27
7.2.170.0070.00715.12
7.2.60.0030.01216.81
7.2.50.0110.00416.59
7.2.00.0000.00919.11
7.1.330.0070.00715.75
7.1.320.0080.00415.57
7.1.310.0090.00315.92
7.1.300.0000.01415.90
7.1.290.0000.01515.75
7.1.280.0040.00415.81
7.1.270.0000.01415.83
7.1.260.0040.00416.03
7.1.200.0240.00815.78
7.1.100.0120.00918.39
7.1.70.0040.00417.21
7.1.60.0030.02019.43
7.1.50.0040.00717.11
7.1.00.0070.07022.46
7.0.200.0470.00614.71
7.0.60.0070.08019.92
7.0.50.0100.07717.89
7.0.40.0100.03720.27
7.0.30.0200.05720.34
7.0.20.0300.04320.12
7.0.10.0070.04320.05
7.0.00.0100.08720.22
5.6.280.0170.03320.94
5.6.210.0030.04020.54
5.6.200.0070.06718.20
5.6.190.0070.08320.58
5.6.180.0300.04020.42
5.6.170.0170.05020.39
5.6.160.0070.07020.39
5.6.150.0100.07718.29
5.6.140.0070.06018.28
5.6.130.0070.05318.24
5.6.120.0070.05721.13
5.6.110.0000.09021.04
5.6.100.0170.07320.91
5.6.90.0070.08321.02
5.6.80.0100.08020.32
5.5.350.0400.07020.43
5.5.340.0030.07318.07
5.5.330.0200.06320.57
5.5.320.0200.04720.19
5.5.310.0270.07320.35
5.5.300.0000.08717.98
5.5.290.0170.06718.07
5.5.280.0130.04720.92
5.5.270.0170.06020.92
5.5.260.0030.08020.81
5.5.250.0100.08320.60
5.5.240.0000.04020.35
5.4.450.0200.05719.33
5.4.440.0100.06719.17
5.4.430.0330.05719.46
5.4.420.0170.06019.38
5.4.410.0170.05319.31
5.4.400.0100.06718.84
5.4.390.0200.05019.06
5.4.380.0400.05019.28
5.4.370.0230.07019.06
5.4.360.0130.06019.06
5.4.350.0230.05319.06
5.4.340.0230.05018.88
5.4.320.0200.05319.25
5.4.310.0230.05319.14
5.4.300.0300.04719.14
5.4.290.0270.05019.20
5.4.280.0170.06019.30
5.4.270.0170.05019.37
5.4.260.0400.05319.14
5.4.250.0230.06319.30
5.4.240.0230.06019.11
5.4.230.0300.04318.85
5.4.220.0170.06318.86
5.4.210.0270.05719.10
5.4.200.0230.05019.22
5.4.190.0170.05319.27
5.4.180.0230.04719.14
5.4.170.0200.05019.22
5.4.160.0230.04719.26
5.4.150.0200.05319.27
5.4.140.0230.05016.31
5.4.130.0170.06316.36
5.4.120.0270.05716.64
5.4.110.0330.06016.65
5.4.100.0170.07016.56
5.4.90.0270.04716.63
5.4.80.0270.06316.46
5.4.70.0130.05716.32
5.4.60.0070.06016.61
5.4.50.0130.05316.67
5.4.40.0230.04716.60
5.4.30.0300.06016.61
5.4.20.0130.05716.49
5.4.10.0170.05016.21
5.4.00.0300.05715.91

preferences:
56.64 ms | 401 KiB | 5 Q