3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $values = array( 'foo', 'bar', 'baz' ); $newarray = array(); foreach($values as $k => $v) { $newarray[$k] = $v; if($k == 'bar') $newarray = kon; } echo implode(' ', $newarray); ?>
based on eauPv
Output for 7.2.0
Warning: Use of undefined constant kon - assumed 'kon' (this will throw an Error in a future version of PHP) in /in/BKncp on line 14 Warning: implode(): Invalid arguments passed in /in/BKncp on line 17
Output for 5.3.21 - 7.1.10
Notice: Use of undefined constant kon - assumed 'kon' in /in/BKncp on line 14 Warning: implode(): Invalid arguments passed in /in/BKncp on line 17