3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array( 'Test' => 1, 'OtherKey' => 2 ); $keyTranslation = array( 'Test' => 'test', 'OtherKey' => 'OtherKey' ); function test(&$arr, $keyTranslation) { foreach ($arr as $key => $value) { $arr[$keyTranslation[$key]] = $value; unset($arr[$key]); } } var_dump(test($arr, $keyTranslation));
based on YOZus
Output for 7.0.0 - 7.2.0
NULL
Output for 5.3.19 - 5.6.28
Notice: Undefined index: test in /in/hXvdA on line 14 NULL