<?php
'a' => NULL,
'b' => 1,
'c' => 1,
'd' => NULL
);
'a' => 1,
'b' => NULL,
'c' => 1,
'd' => NULL,
);
foreach($a as $key => $val)
{
if($key == NULL && $b[$key] == NULL)
{
$c[$key] = $val;
} else if($key != NULL && $b[$key] == NULL) {
$c[$key]= $val;
} else if($key != NULL && $b[$key] != NULL) {
$c[$key]= $b[$key];
} else {
$c[$key]= $b[$key];
}
}
PD9waHAKCiAgICAkYSA9IGFycmF5KAoJCSdhJyA9PiBOVUxMLAoJCSdiJyA9PiAxLAoJCSdjJyA9PiAxLAoJCSdkJyA9PiBOVUxMCgkpOwoJCgkkYiA9IGFycmF5KAoJCSdhJyA9PiAxLAoJCSdiJyA9PiBOVUxMLAoJCSdjJyA9PiAxLCAgIAoJCSdkJyA9PiBOVUxMLAoJKTsKCQoJJGMgPSBhcnJheSgpOwoJZm9yZWFjaCgkYSBhcyAka2V5ID0+ICR2YWwpCgl7CgkJaWYoJGtleSA9PSBOVUxMICYmICRiWyRrZXldID09IE5VTEwpCgkJewoJCQkkY1ska2V5XSA9ICR2YWw7CgkJfSBlbHNlIGlmKCRrZXkgIT0gTlVMTCAmJiAkYlska2V5XSA9PSBOVUxMKSB7CgkJCSRjWyRrZXldPSAkdmFsOwoJCX0gZWxzZSBpZigka2V5ICE9IE5VTEwgJiYgJGJbJGtleV0gIT0gTlVMTCkgewoJCQkkY1ska2V5XT0gJGJbJGtleV07CgkJfSBlbHNlIHsKCQkJJGNbJGtleV09ICRiWyRrZXldOwoJCX0KCX0KCXZhcl9kdW1wKCRjKTs=