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($array);

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.62
8.3.50.0080.01021.91
8.3.40.0090.00918.97
8.3.30.0120.00318.76
8.3.20.0040.00420.37
8.3.10.0080.00023.52
8.3.00.0050.00319.38
8.2.180.0100.01016.50
8.2.170.0120.00322.96
8.2.160.0070.00722.13
8.2.150.0030.00724.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0030.00617.75
8.2.110.0050.00522.18
8.2.100.0070.00317.93
8.2.90.0000.00819.17
8.2.80.0040.00417.97
8.2.70.0080.00017.63
8.2.60.0000.00917.93
8.2.50.0040.00418.07
8.2.40.0050.00319.52
8.2.30.0000.00720.59
8.2.20.0050.00317.69
8.2.10.0020.00518.06
8.2.00.0040.00418.16
8.1.280.0090.00925.92
8.1.270.0040.00423.84
8.1.260.0070.00026.35
8.1.250.0070.00028.09
8.1.240.0090.00022.46
8.1.230.0090.00317.76
8.1.220.0040.00417.78
8.1.210.0030.00618.77
8.1.200.0030.00717.38
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0080.00018.43
8.1.160.0040.00422.03
8.1.150.0000.00818.91
8.1.140.0080.00019.61
8.1.130.0020.00517.72
8.1.120.0070.00017.39
8.1.110.0000.00717.49
8.1.100.0000.00817.51
8.1.90.0000.00717.49
8.1.80.0060.00317.50
8.1.70.0040.00417.47
8.1.60.0040.00417.56
8.1.50.0000.00817.61
8.1.40.0000.00917.43
8.1.30.0040.00417.70
8.1.20.0030.00517.71
8.1.10.0000.00717.54
8.1.00.0000.00817.51
8.0.300.0080.00018.77
8.0.290.0000.00716.75
8.0.280.0030.00318.33
8.0.270.0000.00817.17
8.0.260.0080.00017.35
8.0.250.0080.00016.86
8.0.240.0040.00416.86
8.0.230.0030.00316.95
8.0.220.0040.00416.82
8.0.210.0080.00016.99
8.0.200.0030.00316.95
8.0.190.0040.00416.95
8.0.180.0000.00816.92
8.0.170.0080.00016.88
8.0.160.0030.00516.97
8.0.150.0030.00316.88
8.0.140.0000.00716.84
8.0.130.0000.00513.45
8.0.120.0050.00316.86
8.0.110.0040.00416.98
8.0.100.0040.00416.89
8.0.90.0000.00716.89
8.0.80.0000.01516.81
8.0.70.0040.00416.81
8.0.60.0040.00416.95
8.0.50.0040.00416.92
8.0.30.0130.00817.00
8.0.20.0120.00617.40
8.0.10.0050.00317.00
8.0.00.0110.00816.97
7.4.330.0020.00215.09
7.4.320.0030.00316.61
7.4.300.0060.00016.59
7.4.290.0000.00716.62
7.4.280.0030.00616.52
7.4.270.0000.00716.64
7.4.260.0030.00316.47
7.4.250.0070.00016.59
7.4.240.0000.00816.53
7.4.230.0050.00316.52
7.4.220.0030.01916.51
7.4.210.0070.00816.74
7.4.200.0030.00316.48
7.4.160.0110.00416.38
7.4.150.0100.01017.40
7.4.140.0090.01217.86
7.4.130.0110.01016.53
7.4.120.0050.01116.53
7.4.110.0030.01516.44
7.4.100.0120.01216.51
7.4.90.0120.00416.46
7.4.80.0130.01019.39
7.4.70.0150.00616.60
7.4.60.0030.01416.50
7.4.50.0040.00416.62
7.4.40.0110.00716.42
7.4.30.0090.00916.77
7.4.00.0120.00415.00
7.3.330.0060.00013.46
7.3.320.0030.00313.34
7.3.310.0080.00016.48
7.3.300.0050.00216.43
7.3.290.0000.00716.43
7.3.280.0090.00816.34
7.3.270.0070.01017.40
7.3.260.0090.00916.32
7.3.250.0120.00616.60
7.3.240.0110.00616.60
7.3.230.0070.01316.57
7.3.210.0130.00316.67
7.3.200.0150.00316.39
7.3.190.0090.00716.50
7.3.180.0080.00916.50
7.3.170.0160.00416.37
7.3.160.0060.01016.56
7.2.330.0040.01816.58
7.2.320.0120.00916.88
7.2.310.0070.01016.60
7.2.300.0100.00916.93
7.2.290.0100.00716.46
7.2.60.0070.00717.02
7.2.00.0040.01219.21
7.1.200.0040.01215.84
7.1.100.0130.00318.09
7.1.70.0000.00817.30
7.1.60.0070.01119.43
7.1.50.0100.00717.05
7.1.00.0070.07322.42
7.0.200.0030.01014.97
7.0.60.0170.07020.02
7.0.50.0100.08017.87
7.0.40.0170.05720.11
7.0.30.0070.08320.30
7.0.20.0270.04720.26
7.0.10.0000.04720.08
7.0.00.0100.08320.22
5.6.280.0030.05721.09
5.6.210.0070.05720.63
5.6.200.0100.06318.23
5.6.190.0070.07320.61
5.6.180.0500.06720.52
5.6.170.0300.04020.57
5.6.160.0130.08320.56
5.6.150.0070.03718.20
5.6.140.0070.08718.18
5.6.130.0030.07318.25
5.6.120.0030.06021.15
5.6.110.0170.07321.03
5.6.100.0170.08021.06
5.6.90.0100.07721.02
5.6.80.0200.07320.46
5.5.350.0170.04020.34
5.5.340.0100.08317.93
5.5.330.0100.07020.19
5.5.320.0130.06020.32
5.5.310.0270.06020.34
5.5.300.0100.07717.94
5.5.290.0100.07317.95
5.5.280.0030.04720.67
5.5.270.0170.06720.66
5.5.260.0070.08720.80
5.5.250.0070.06020.70
5.5.240.0030.07720.16
5.4.450.0200.05319.63
5.4.440.0370.05319.31
5.4.430.0300.06019.58
5.4.420.0430.05719.48
5.4.410.0170.06319.31
5.4.400.0170.05019.16
5.4.390.0230.05019.36
5.4.380.0100.06018.87
5.4.370.0070.06719.06
5.4.360.0100.06019.23
5.4.350.0170.05019.27
5.4.340.0030.06719.32
5.4.320.0270.06019.02
5.4.310.0670.05019.25
5.4.300.0630.05319.14
5.4.290.0170.05319.28
5.4.280.0400.04319.00
5.4.270.0100.06319.24
5.4.260.0200.05319.36
5.4.250.0200.05718.86
5.4.240.0230.07719.09
5.4.230.0300.04719.25
5.4.220.0130.08019.05
5.4.210.0270.05318.86
5.4.200.0230.05719.36
5.4.190.0100.06318.82
5.4.180.0270.06719.36
5.4.170.0200.06318.97
5.4.160.0100.06318.85
5.4.150.0530.05319.14
5.4.140.0530.05316.42
5.4.130.0100.05316.55
5.4.120.0100.05016.31
5.4.110.0100.05716.65
5.4.100.0500.06016.30
5.4.90.0500.05016.26
5.4.80.0330.05316.66
5.4.70.0330.06316.31
5.4.60.0570.04716.60
5.4.50.0630.05016.59
5.4.40.0730.04016.48
5.4.30.0670.04716.16
5.4.20.0500.06016.42
5.4.10.0600.04716.60
5.4.00.0530.05715.73

preferences:
69.04 ms | 401 KiB | 5 Q