You can merge the two conditions if (isset && $stat...)