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.40.0150.00318.97
8.3.30.0090.00618.85
8.3.20.0040.00420.20
8.3.10.0040.00423.61
8.3.00.0080.00019.51
8.2.170.0120.00322.96
8.2.160.0070.00722.08
8.2.150.0060.00324.18
8.2.140.0000.00724.66
8.2.130.0070.00026.16
8.2.120.0030.00617.75
8.2.110.0100.00020.57
8.2.100.0040.00818.03
8.2.90.0050.00319.39
8.2.80.0030.00517.97
8.2.70.0000.00817.61
8.2.60.0000.00817.93
8.2.50.0000.00818.07
8.2.40.0000.00719.52
8.2.30.0070.00020.60
8.2.20.0060.00317.70
8.2.10.0040.00418.14
8.2.00.0080.00018.27
8.1.270.0090.00023.77
8.1.260.0070.00026.35
8.1.250.0030.01028.09
8.1.240.0060.00322.54
8.1.230.0070.00417.79
8.1.220.0050.00317.74
8.1.210.0050.00518.77
8.1.200.0030.00717.47
8.1.190.0080.00017.48
8.1.180.0030.00618.10
8.1.170.0050.00318.50
8.1.160.0050.00322.05
8.1.150.0080.00018.84
8.1.140.0050.00319.64
8.1.130.0030.00517.64
8.1.120.0070.00017.49
8.1.110.0070.00017.43
8.1.100.0030.00517.42
8.1.90.0040.00417.48
8.1.80.0030.00517.49
8.1.70.0000.00717.46
8.1.60.0030.00617.68
8.1.50.0040.00417.43
8.1.40.0030.00617.40
8.1.30.0050.00317.68
8.1.20.0040.00417.62
8.1.10.0030.00617.65
8.1.00.0040.00417.43
8.0.300.0050.00318.77
8.0.290.0040.00416.63
8.0.280.0070.00018.54
8.0.270.0070.00017.34
8.0.260.0030.00317.30
8.0.250.0000.00816.93
8.0.240.0040.00417.03
8.0.230.0030.00317.01
8.0.220.0040.00416.83
8.0.210.0040.00416.86
8.0.200.0060.00016.87
8.0.190.0030.00617.01
8.0.180.0050.00216.86
8.0.170.0040.00416.96
8.0.160.0060.00317.02
8.0.150.0090.00016.86
8.0.140.0040.00416.84
8.0.130.0050.00013.37
8.0.120.0040.00416.72
8.0.110.0050.00216.77
8.0.100.0050.00316.79
8.0.90.0030.00516.89
8.0.80.0090.00616.93
8.0.70.0030.00516.90
8.0.60.0040.00416.72
8.0.50.0000.00717.04
8.0.30.0100.00717.17
8.0.20.0120.00717.40
8.0.10.0040.00416.84
8.0.00.0090.00816.71
7.4.330.0000.00515.08
7.4.320.0030.00316.64
7.4.300.0000.00616.64
7.4.290.0000.00716.64
7.4.280.0080.00016.52
7.4.270.0000.00716.54
7.4.260.0000.00716.59
7.4.250.0040.00416.42
7.4.240.0030.00416.47
7.4.230.0070.00016.71
7.4.220.0130.00616.66
7.4.210.0060.00816.58
7.4.200.0030.00316.38
7.4.160.0130.00916.47
7.4.150.0120.00917.40
7.4.140.0120.00717.86
7.4.130.0080.01116.54
7.4.120.0140.00316.55
7.4.110.0070.01016.49
7.4.100.0060.01116.48
7.4.90.0060.01216.59
7.4.80.0100.01019.39
7.4.70.0070.01016.54
7.4.60.0130.01016.59
7.4.50.0050.00316.59
7.4.40.0090.00916.58
7.4.30.0040.01416.50
7.4.10.0130.00916.34
7.4.00.0140.00115.38
7.3.330.0060.00013.14
7.3.320.0050.00013.39
7.3.310.0050.00316.44
7.3.300.0040.00416.25
7.3.290.0040.00316.43
7.3.280.0070.01316.37
7.3.270.0120.00617.40
7.3.260.0090.00916.35
7.3.250.0120.00716.59
7.3.240.0130.00616.64
7.3.230.0070.01116.61
7.3.210.0060.01016.52
7.3.200.0140.00416.54
7.3.190.0100.00716.52
7.3.180.0160.00016.60
7.3.170.0150.00016.57
7.3.160.0070.01316.32
7.3.130.0130.00616.18
7.3.120.0100.00715.39
7.3.110.0060.01115.55
7.3.100.0070.00715.75
7.3.90.0050.01015.84
7.3.80.0070.00915.37
7.3.70.0080.00515.49
7.3.60.0060.01115.54
7.3.50.0050.01015.69
7.3.40.0100.00415.54
7.3.30.0040.01115.62
7.3.20.0080.00917.34
7.3.10.0050.00716.81
7.3.00.0070.00817.07
7.2.330.0100.00716.52
7.2.320.0100.00716.57
7.2.310.0120.00916.80
7.2.300.0100.01316.66
7.2.290.0070.01016.84
7.2.260.0070.01416.48
7.2.250.0050.01215.93
7.2.240.0050.01315.63
7.2.230.0090.00915.70
7.2.220.0080.00515.95
7.2.210.0030.01215.69
7.2.200.0030.01015.81
7.2.190.0070.00715.73
7.2.180.0030.01015.83
7.2.170.0100.00715.82
7.2.160.0180.00016.57
7.2.150.0140.00318.41
7.2.140.0070.01018.65
7.2.130.0070.00817.62
7.2.120.0120.00717.52
7.2.110.0080.01017.27
7.2.100.0070.01217.45
7.2.90.0080.01017.46
7.2.80.0080.00917.61
7.2.70.0110.00617.68
7.2.60.0080.00717.31
7.2.50.0120.00817.47
7.2.40.0090.00617.63
7.2.30.0100.00817.60
7.2.20.0050.01317.48
7.2.10.0060.01417.54
7.2.00.0080.00918.22
7.1.330.0050.01116.58
7.1.320.0110.00316.52
7.1.310.0100.00316.78
7.1.300.0080.00716.45
7.1.290.0110.00416.59
7.1.280.0030.01216.42
7.1.270.0070.00916.56
7.1.260.0050.01116.58
7.1.250.0060.01216.29
7.1.240.0030.01317.21
7.1.230.0090.00917.21
7.1.220.0080.00817.44
7.1.210.0070.01017.39
7.1.200.0030.01016.53
7.1.190.0110.00417.39
7.1.180.0100.00717.16
7.1.170.0110.00617.23
7.1.160.0120.00417.27
7.1.150.0000.01117.40
7.1.140.0070.01017.16
7.1.130.0060.00617.30
7.1.120.0060.00917.18
7.1.110.0070.00317.54
7.1.100.0070.00817.89
7.1.90.0100.01017.50
7.1.80.0070.00317.37
7.1.70.0060.00617.14
7.1.60.0090.01118.38
7.1.50.0070.01316.98
7.1.40.0000.01517.51
7.1.30.0030.00617.26
7.1.20.0030.00917.57
7.1.10.0040.01217.22
7.1.00.0050.04019.79
7.0.330.0030.00917.04
7.0.320.0070.01017.02
7.0.310.0060.00917.04
7.0.300.0130.00617.03
7.0.290.0130.00416.98
7.0.280.0040.01116.82
7.0.270.0060.00817.09
7.0.260.0100.01017.00
7.0.250.0030.01617.00
7.0.240.0100.01017.11
7.0.230.0110.00516.86
7.0.220.0100.01016.82
7.0.210.0110.00716.97
7.0.200.0070.01016.09
7.0.190.0040.01217.05
7.0.180.0080.00817.14
7.0.170.0060.00616.94
7.0.160.0030.01217.04
7.0.150.0080.00816.96
7.0.140.0030.01717.05
7.0.130.0100.01016.98
7.0.120.0090.00617.11
7.0.110.0110.00717.11
7.0.100.0090.01016.91
7.0.90.0100.01017.06
7.0.80.0030.01217.20
7.0.70.0130.00617.09
7.0.60.0110.03018.49
7.0.50.0100.04017.44
7.0.40.0030.02717.58
7.0.30.0090.02317.66
7.0.20.0170.04517.55
7.0.10.0090.02417.63
7.0.00.0070.04917.58
5.6.400.0070.01716.07
5.6.390.0150.00716.07
5.6.380.0130.00616.13
5.6.370.0140.00715.83
5.6.360.0070.01116.40
5.6.350.0170.00015.86
5.6.340.0100.01015.93
5.6.330.0070.01115.84
5.6.320.0080.00815.95
5.6.310.0140.00316.28
5.6.300.0140.00715.94
5.6.290.0040.01215.89
5.6.280.0070.02218.39
5.6.270.0110.00816.05
5.6.260.0070.01016.03
5.6.250.0040.01716.15
5.6.240.0060.01316.06
5.6.230.0130.00616.04
5.6.220.0080.01115.89
5.6.210.0050.04118.25
5.6.200.0050.02917.14
5.6.190.0090.03618.25
5.6.180.0230.04518.26
5.6.170.0180.03318.21
5.6.160.0120.02318.13
5.6.150.0090.02517.23
5.6.140.0080.02817.12
5.6.130.0030.05117.18
5.6.120.0130.04018.46
5.6.110.0140.04418.50
5.6.100.0070.05218.55
5.6.90.0100.04518.43
5.6.80.0020.03118.23
5.6.70.0060.00915.90
5.6.60.0070.00716.02
5.6.50.0000.01616.02
5.6.40.0070.00716.14
5.6.30.0060.00916.15
5.6.20.0030.01515.96
5.6.10.0070.01115.87
5.6.00.0000.01616.20
5.5.380.0060.01316.06
5.5.370.0140.01416.25
5.5.360.0030.02016.21
5.5.350.0120.04018.11
5.5.340.0090.04616.94
5.5.330.0070.05218.10
5.5.320.0170.03017.97
5.5.310.0240.04218.27
5.5.300.0050.04816.96
5.5.290.0080.04716.93
5.5.280.0080.02718.39
5.5.270.0140.04018.46
5.5.260.0080.03018.28
5.5.250.0100.04418.22
5.5.240.0060.04018.09
5.5.230.0000.01915.80
5.5.220.0000.01515.81
5.5.210.0090.00915.85
5.5.200.0030.01515.82
5.5.190.0030.01315.77
5.5.180.0090.00915.98
5.5.170.0110.00815.96
5.5.160.0040.01415.92
5.5.150.0080.01215.89
5.5.140.0120.01515.88
5.5.130.0100.01415.60
5.5.120.0150.00515.51
5.5.110.0090.00915.99
5.5.100.0170.00315.48
5.5.90.0100.00615.86
5.5.80.0110.01415.89
5.5.70.0170.00915.92
5.5.60.0030.00815.61
5.5.50.0170.00715.94
5.5.40.0110.02115.64
5.5.30.0100.02316.02
5.5.20.0100.01615.57
5.5.10.0060.01615.67
5.5.00.0120.00915.60
5.4.450.0300.03316.09
5.4.440.0430.02716.06
5.4.430.0480.03516.05
5.4.420.0430.03216.19
5.4.410.0320.03616.09
5.4.400.0390.03015.95
5.4.390.0380.04215.75
5.4.380.0320.03215.82
5.4.370.0280.03216.11
5.4.360.0320.03416.07
5.4.350.0330.02815.88
5.4.340.0410.03516.19
5.4.330.0110.00312.75
5.4.320.0480.02615.96
5.4.310.0370.02715.95
5.4.300.0320.03015.93
5.4.290.0450.03015.85
5.4.280.0400.04415.74
5.4.270.0460.03115.88
5.4.260.0420.03515.97
5.4.250.0390.03016.15
5.4.240.0320.03516.02
5.4.230.0400.03116.03
5.4.220.0320.03715.73
5.4.210.0450.04016.01
5.4.200.0400.03216.18
5.4.190.0400.03215.77
5.4.180.0400.03516.18
5.4.170.0400.03115.83
5.4.160.0420.02915.94
5.4.150.0390.03915.83
5.4.140.0450.03114.72
5.4.130.0350.02814.51
5.4.120.0360.03614.70
5.4.110.0400.02814.68
5.4.100.0400.03014.79
5.4.90.0380.02814.45
5.4.80.0390.03214.50
5.4.70.0290.03214.63
5.4.60.0300.03514.54
5.4.50.0170.02814.56
5.4.40.0110.02814.49
5.4.30.0100.03214.45
5.4.20.0320.03714.68
5.4.10.0370.03614.38
5.4.00.0400.03814.27

preferences:
49.55 ms | 400 KiB | 5 Q