$guests = \GuestsModel::getGuestListByRoom($reservationId, $roomDetail->roomNumber); $children = array_filter((array) $guests, function($g) { return isset($g['guestAge']) && $g['guestAge'] <= 17; });