3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $foo = array('foo1' => 'foo1', 'foo2' => 'foo2', 'foo3' => 'foo3'); $new = array(); foreach ($foo as $k => $v) { $new[':'.$k] = $v; } var_dump($new);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(3) { [":foo1"]=> string(4) "foo1" [":foo2"]=> string(4) "foo2" [":foo3"]=> string(4) "foo3" }