3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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) { error_log(var_export($page, TRUE), 3, '/tmp/ff.txt'); // 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]); } } } system_module_test_page_attachments_alter($array); print_r($array);
based on OjYHI
Output for 5.4.0 - 7.2.0
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 ) ) ) )
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/LHUfG on line 99
Process exited with code 255.