My gut tells me that there is a better, perhaps one-line refactor for the following code:
if (isset($x))
{
if (isset($y))
{
$z = array_merge($x,$y);
}
else
{
$z = $x;
}
}
else
{
$z = $y;
}
If I wasn't worried about warning errors, a simple array_merge($x,$y)
would work, but I'd like to know a better way to do this. Thoughts?