<?php
{
foreach ($chaves as $chave)
{
if (isset($z[$chave]) === false) { }
{
$z[$chave]['X'] = $arrX[ $chave ];
}
{
$z[$chave]['Y'] = $arrY[ $chave ];
}
}
return $z;
}
$arX = array('AAA' => 173.696, 'BBB' => 72.436, 'CCC' => 142.692); $arY = array('AAA' => 127, 'DDD' => 72.333);
$novaArray = mesclar($arX, $arY);
PD9waHAKCmZ1bmN0aW9uIG1lc2NsYXIoYXJyYXkgJGFyclgsIGFycmF5ICRhcnJZKQp7CiAgICAkeiA9IGFycmF5KCk7CiAgICAkY2hhdmVzID0gYXJyYXlfbWVyZ2UoIGFycmF5X2tleXMoJGFyclgpLCBhcnJheV9rZXlzKCRhcnJZKSApOyAvL1BlZ2EgYXMgY2hhdmVzIGRlIGFtYmFzIGFycmF5cwogICAgCiAgICBmb3JlYWNoICgkY2hhdmVzIGFzICRjaGF2ZSkKICAgIHsKICAgICAgICBpZiAoaXNzZXQoJHpbJGNoYXZlXSkgPT09IGZhbHNlKSB7CiAgICAgICAgICAgICR6WyRjaGF2ZV0gPSBhcnJheSgpOwogICAgICAgIH0KCiAgICAgICAgaWYgKGFycmF5X2tleV9leGlzdHMoJGNoYXZlLCAkYXJyWCkpCiAgICAgICAgewogICAgICAgICAgICAkelskY2hhdmVdWydYJ10gPSAkYXJyWFsgJGNoYXZlIF07CiAgICAgICAgfQoKICAgICAgICBpZiAoYXJyYXlfa2V5X2V4aXN0cygkY2hhdmUsICRhcnJZKSkKICAgICAgICB7CiAgICAgICAgICAgICR6WyRjaGF2ZV1bJ1knXSA9ICRhcnJZWyAkY2hhdmUgXTsKICAgICAgICB9CiAgICB9CgogICAgcmV0dXJuICR6Owp9CgokYXJYID0gYXJyYXkoJ0FBQScgPT4gMTczLjY5NiwgJ0JCQicgPT4gNzIuNDM2LCAnQ0NDJyA9PiAxNDIuNjkyKTsKJGFyWSA9IGFycmF5KCdBQUEnID0+IDEyNywgJ0RERCcgPT4gNzIuMzMzKTsKCiRub3ZhQXJyYXkgPSBtZXNjbGFyKCRhclgsICRhclkpOwoKcHJpbnRfciggJG5vdmFBcnJheSApOw==