3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $social_array = array( "facebook" => array( 'class' => "facebook", 'url' => 'https://www.facebook.com/', 'handle' => 'Mage::getStoreConfig(\'social_code/social_group/twitter_field\')' ), "twitter" => array( 'class' => "facebook", 'url' => 'https://www.facebook.com/', 'handle' => 'Mage::getStoreConfig(\'social_code/social_group/twitter_field\')' ), "linked-in" => array( 'class' => "facebook", 'url' => 'https://www.facebook.com/', 'handle' => 'Mage::getStoreConfig(\'social_code/social_group/twitter_field\')' ), "google-plus" => array( 'class' => "facebook", 'url' => 'https://www.facebook.com/', 'handle' => 'Mage::getStoreConfig(\'social_code/social_group/twitter_field\')' ) ); $html = '<ul>'; foreach ($social_array as $name => $group_array){ foreach ($group_array as $className => $class_array){ $html .= '<li><a href="' . $class_array['url'] . $class_array['handle'] .'" class="' . $class_array['class']. '">'. $name. '</a></li>'; } } $html .= '</ul>'; print $html; ?>
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 Warning: Illegal string offset 'url' in /in/P0S0c on line 29 Warning: Illegal string offset 'handle' in /in/P0S0c on line 29 Warning: Illegal string offset 'class' in /in/P0S0c on line 29 <ul><li><a href="ff" class="f">facebook</a></li><li><a href="hh" class="h">facebook</a></li><li><a href="MM" class="M">facebook</a></li><li><a href="ff" class="f">twitter</a></li><li><a href="hh" class="h">twitter</a></li><li><a href="MM" class="M">twitter</a></li><li><a href="ff" class="f">linked-in</a></li><li><a href="hh" class="h">linked-in</a></li><li><a href="MM" class="M">linked-in</a></li><li><a href="ff" class="f">google-plus</a></li><li><a href="hh" class="h">google-plus</a></li><li><a href="MM" class="M">google-plus</a></li></ul>
Output for 4.3.0 - 5.3.29, hhvm-3.10.0 - 3.12.0
<ul><li><a href="ff" class="f">facebook</a></li><li><a href="hh" class="h">facebook</a></li><li><a href="MM" class="M">facebook</a></li><li><a href="ff" class="f">twitter</a></li><li><a href="hh" class="h">twitter</a></li><li><a href="MM" class="M">twitter</a></li><li><a href="ff" class="f">linked-in</a></li><li><a href="hh" class="h">linked-in</a></li><li><a href="MM" class="M">linked-in</a></li><li><a href="ff" class="f">google-plus</a></li><li><a href="hh" class="h">google-plus</a></li><li><a href="MM" class="M">google-plus</a></li></ul>