Index: src/wp-admin/widgets.php
===================================================================
--- src/wp-admin/widgets.php	(revision 35097)
+++ src/wp-admin/widgets.php	(working copy)
@@ -89,7 +89,7 @@
 	if ( 'wp_inactive_widgets' == $sidebar_id )
 		continue;
 
-	if ( !isset( $wp_registered_sidebars[ $sidebar_id ] ) ) {
+	if ( ! is_registered_sidebar( $sidebar_id ) ) {
 		if ( ! empty( $widgets ) ) { // register the inactive_widgets area as sidebar
 			register_sidebar(array(
 				'name' => __( 'Inactive Sidebar (not used)' ),
@@ -155,7 +155,7 @@
 
 		/**
 		 * Fires immediately after a widget has been marked for deletion.
-		 * 
+		 *
 		 * @since 4.4.0
 		 *
 		 * @param string $widget_id  ID of the widget marked for deletion.
Index: src/wp-includes/class-wp-customize-widgets.php
===================================================================
--- src/wp-includes/class-wp-customize-widgets.php	(revision 35097)
+++ src/wp-includes/class-wp-customize-widgets.php	(working copy)
@@ -365,7 +365,7 @@
 				$sidebar_widget_ids = array();
 			}
 
-			$is_registered_sidebar = isset( $wp_registered_sidebars[ $sidebar_id ] );
+			$is_registered_sidebar = is_registered_sidebar( $sidebar_id );
 			$is_inactive_widgets   = ( 'wp_inactive_widgets' === $sidebar_id );
 			$is_active_sidebar     = ( $is_registered_sidebar && ! $is_inactive_widgets );
 
@@ -1102,14 +1102,12 @@
 	 * @since 3.9.0
 	 * @access public
 	 *
-	 * @global array $wp_registered_sidebars
-	 *
 	 * @param bool   $is_active  Whether the sidebar is active.
 	 * @param string $sidebar_id Sidebar ID.
 	 * @return bool
 	 */
 	public function tally_sidebars_via_is_active_sidebar_calls( $is_active, $sidebar_id ) {
-		if ( isset( $GLOBALS['wp_registered_sidebars'][$sidebar_id] ) ) {
+		if ( is_registered_sidebar( $sidebar_id ) ) {
 			$this->rendered_sidebars[] = $sidebar_id;
 		}
 		/*
@@ -1130,14 +1128,12 @@
 	 * @since 3.9.0
 	 * @access public
 	 *
-	 * @global array $wp_registered_sidebars
-	 *
 	 * @param bool   $has_widgets Whether the current sidebar has widgets.
 	 * @param string $sidebar_id  Sidebar ID.
 	 * @return bool
 	 */
 	public function tally_sidebars_via_dynamic_sidebar_calls( $has_widgets, $sidebar_id ) {
-		if ( isset( $GLOBALS['wp_registered_sidebars'][$sidebar_id] ) ) {
+		if ( is_registered_sidebar( $sidebar_id ) ) {
 			$this->rendered_sidebars[] = $sidebar_id;
 		}
 
Index: src/wp-includes/widget-functions.php
===================================================================
--- src/wp-includes/widget-functions.php	(revision 35097)
+++ src/wp-includes/widget-functions.php	(working copy)
@@ -96,13 +96,14 @@
 		if ( isset($args['id']) ) {
 			$_args['id'] = $args['id'];
 			$n = 2; // Start at -2 for conflicting custom ID's
-			while ( isset($wp_registered_sidebars[$_args['id']]) )
+			while ( is_registered_sidebar( $_args['id'] ) ) {
 				$_args['id'] = $args['id'] . '-' . $n++;
+			}
 		} else {
-			$n = count($wp_registered_sidebars);
+			$n = count( $wp_registered_sidebars );
 			do {
 				$_args['id'] = 'sidebar-' . ++$n;
-			} while ( isset($wp_registered_sidebars[$_args['id']]) );
+			} while ( is_registered_sidebar( $_args['id'] ) );
 		}
 		register_sidebar($_args);
 	}
@@ -206,6 +207,22 @@
 }
 
 /**
+ * Checks if a sidebar is registered.
+ *
+ * @since 4.4.0
+ *
+ * @global array $wp_registered_sidebars Registered sidebars.
+ *
+ * @param string $name The ID of the sidebar when it was added.
+ *
+ * @return bool True if the sidebar is registered, false otherwise.
+ */
+function is_registered_sidebar( $name ) {
+	global $wp_registered_sidebars;
+	return isset( $wp_registered_sidebars[ $name ] );
+}
+
+/**
  * Register an instance of a widget.
  *
  * The default widget option is 'classname' that can be overridden.
