3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foos = array( array( 'name' => 'foo', 'something_else' => 'does not matter' ), array( 'name' => 'bar', 'something_else' => 'really does not matter' ) ); $bar = ''; foreach($foos as $foo) { $name = $foo['name']; $bar .= <<<HTML <span>{$name}</span>, HTML; } $bar = rtrim($bar, ','); echo $bar;
Output for 4.3.0 - 7.1.0
<span>foo</span>,<span>bar</span>