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 5.3.0 - 7.1.0
<span>foo</span>, <span>bar</span>
Output for 4.3.1 - 4.4.1, 4.4.3 - 5.1.1, 5.1.3 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/K47v9 on line 21 <span>foo</span>, <span>bar</span>
Output for 4.4.2, 5.1.2
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/K47v9 on line 22 <span>foo</span>, <span>bar</span>
Output for 4.3.0
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/RVYXG on line 21 <span>foo</span>, <span>bar</span>