3v4l.org

run code in 200+ 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 - 7.2.0
array(3) { [":foo1"]=> string(4) "foo1" [":foo2"]=> string(4) "foo2" [":foo3"]=> string(4) "foo3" }