3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $lists = [['email' => 'test@test.lv', 'mvars' => ['name' => 'bob']],['email' => 'test@test.lv', 'mvars' => ['name' => 'bob']]]; foreach($lists as $list){ $list = array_map(function($key){ var_dump($key); if($key == 'name'){ unset($key); $key = 'newkey'; } else { } },array_keys($list['mvars'])); }; var_dump($lists);
based on sMTSV
Output for 5.6.0 - 7.3.0rc3
string(4) "name" string(4) "name" array(2) { [0]=> array(2) { ["email"]=> string(12) "test@test.lv" ["mvars"]=> array(1) { ["name"]=> string(3) "bob" } } [1]=> array(2) { ["email"]=> string(12) "test@test.lv" ["mvars"]=> array(1) { ["name"]=> string(3) "bob" } } }