Index: /trunk/src/wp-includes/class-walker-category.php
===================================================================
--- /trunk/src/wp-includes/class-walker-category.php	(revision 46412)
+++ /trunk/src/wp-includes/class-walker-category.php	(revision 46413)
@@ -140,5 +140,5 @@
 		$attributes = '';
 		foreach ( $atts as $attr => $value ) {
-			if ( ! empty( $value ) ) {
+			if ( is_scalar( $value ) && '' !== $value && false !== $value ) {
 				$value       = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
 				$attributes .= ' ' . $attr . '="' . $value . '"';
Index: /trunk/src/wp-includes/class-walker-nav-menu.php
===================================================================
--- /trunk/src/wp-includes/class-walker-nav-menu.php	(revision 46412)
+++ /trunk/src/wp-includes/class-walker-nav-menu.php	(revision 46413)
@@ -204,5 +204,5 @@
 		$attributes = '';
 		foreach ( $atts as $attr => $value ) {
-			if ( ! empty( $value ) ) {
+			if ( is_scalar( $value ) && '' !== $value && false !== $value ) {
 				$value       = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
 				$attributes .= ' ' . $attr . '="' . $value . '"';
Index: /trunk/src/wp-includes/class-walker-page.php
===================================================================
--- /trunk/src/wp-includes/class-walker-page.php	(revision 46412)
+++ /trunk/src/wp-includes/class-walker-page.php	(revision 46413)
@@ -183,5 +183,5 @@
 		$attributes = '';
 		foreach ( $atts as $attr => $value ) {
-			if ( ! empty( $value ) ) {
+			if ( is_scalar( $value ) && '' !== $value && false !== $value ) {
 				$value       = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
 				$attributes .= ' ' . $attr . '="' . $value . '"';
Index: /trunk/tests/phpunit/tests/category/walkerCategory.php
===================================================================
--- /trunk/tests/phpunit/tests/category/walkerCategory.php	(revision 46413)
+++ /trunk/tests/phpunit/tests/category/walkerCategory.php	(revision 46413)
@@ -0,0 +1,92 @@
+<?php
+/**
+ * @group taxonomy
+ * @group walker
+ */
+class Tests_Category_Walker_Category extends WP_UnitTestCase {
+
+	/**
+	 * @var \Walker_Category The instance of the walker.
+	 */
+	public $walker;
+
+	/**
+	 * Setup.
+	 */
+	public function setUp() {
+		parent::setUp();
+
+		/** Walker_Category class */
+		require_once ABSPATH . 'wp-includes/class-walker-category.php';
+		$this->walker = new Walker_Category();
+	}
+
+	/**
+	 * @ticket 47720
+	 *
+	 * @dataProvider data_start_el_with_empty_attributes
+	 */
+	public function test_start_el_with_empty_attributes( $value, $expected ) {
+		$output   = '';
+		$category = $this->factory->category->create_and_get();
+		$link     = get_term_link( $category );
+
+		$args = array(
+			'use_desc_for_title' => 0,
+			'style'              => 'list',
+		);
+
+		add_filter(
+			'category_list_link_attributes',
+			function( $atts ) use ( $value ) {
+				$atts['data-test'] = $value;
+				return $atts;
+			}
+		);
+
+		$this->walker->start_el( $output, $category, 0, $args );
+
+		if ( '' !== $expected ) {
+			$expected = sprintf( ' data-test="%s"', $expected );
+		}
+
+		$this->assertSame( "<li class=\"cat-item cat-item-{$category->term_id}\"><a href=\"{$link}\"{$expected}>{$category->name}</a>", trim( $output ) );
+	}
+
+	public function data_start_el_with_empty_attributes() {
+		return array(
+			array(
+				'',
+				'',
+			),
+			array(
+				0,
+				'0',
+			),
+			array(
+				0.0,
+				'0',
+			),
+			array(
+				'0',
+				'0',
+			),
+			array(
+				null,
+				'',
+			),
+			array(
+				false,
+				'',
+			),
+			array(
+				true,
+				'1',
+			),
+			array(
+				array(),
+				'',
+			),
+		);
+	}
+}
Index: /trunk/tests/phpunit/tests/menu/walker-nav-menu-edit.php
===================================================================
--- /trunk/tests/phpunit/tests/menu/walker-nav-menu-edit.php	(revision 46412)
+++ /trunk/tests/phpunit/tests/menu/walker-nav-menu-edit.php	(revision 46413)
@@ -5,5 +5,5 @@
  * @group walker
  */
-class Tests_Walker_Nav_Menu_Edit extends WP_UnitTestCase {
+class Tests_Menu_Walker_Nav_Menu_Edit extends WP_UnitTestCase {
 	protected $_wp_nav_menu_max_depth;
 
Index: /trunk/tests/phpunit/tests/menu/walker-nav-menu.php
===================================================================
--- /trunk/tests/phpunit/tests/menu/walker-nav-menu.php	(revision 46412)
+++ /trunk/tests/phpunit/tests/menu/walker-nav-menu.php	(revision 46413)
@@ -4,5 +4,5 @@
  * @group walker
  */
-class Tests_Walker_Nav_Menu extends WP_UnitTestCase {
+class Tests_Menu_Walker_Nav_Menu extends WP_UnitTestCase {
 
 	/**
@@ -19,5 +19,5 @@
 		parent::setUp();
 
-		/** Walker_Nav_Menu_Edit class */
+		/** Walker_Nav_Menu class */
 		require_once ABSPATH . 'wp-includes/class-walker-nav-menu.php';
 		$this->walker = new Walker_Nav_Menu();
@@ -38,7 +38,7 @@
 
 	/**
-	 * Tests when an items target it _blank, that rel="'noopener noreferrer" is added.
+	 * Tests when an item's target is _blank, that rel="noopener noreferrer" is added.
 	 *
-	 * @ticket #43290
+	 * @ticket 43290
 	 */
 	public function test_noopener_no_referrer_for_target_blank() {
@@ -67,3 +67,83 @@
 		$this->assertSame( "<li id=\"menu-item-{$post_id}\" class=\"menu-item-{$post_id}\"><a target=\"_blank\" rel=\"noopener noreferrer\">{$post_title}</a>", $expected );
 	}
+
+	/**
+	 * @ticket 47720
+	 *
+	 * @dataProvider data_start_el_with_empty_attributes
+	 */
+	public function test_start_el_with_empty_attributes( $value, $expected ) {
+		$output     = '';
+		$post_id    = $this->factory->post->create();
+		$post_title = get_the_title( $post_id );
+
+		$item = array(
+			'ID'        => $post_id,
+			'object_id' => $post_id,
+			'title'     => $post_title,
+			'target'    => '',
+			'xfn'       => '',
+			'current'   => false,
+		);
+
+		$args = array(
+			'before'      => '',
+			'after'       => '',
+			'link_before' => '',
+			'link_after'  => '',
+		);
+
+		add_filter(
+			'nav_menu_link_attributes',
+			function( $atts ) use ( $value ) {
+				$atts['data-test'] = $value;
+				return $atts;
+			}
+		);
+
+		$this->walker->start_el( $output, (object) $item, 0, (object) $args );
+
+		if ( '' !== $expected ) {
+			$expected = sprintf( ' data-test="%s"', $expected );
+		}
+
+		$this->assertSame( "<li id=\"menu-item-{$post_id}\" class=\"menu-item-{$post_id}\"><a{$expected}>{$post_title}</a>", $output );
+	}
+
+	public function data_start_el_with_empty_attributes() {
+		return array(
+			array(
+				'',
+				'',
+			),
+			array(
+				0,
+				'0',
+			),
+			array(
+				0.0,
+				'0',
+			),
+			array(
+				'0',
+				'0',
+			),
+			array(
+				null,
+				'',
+			),
+			array(
+				false,
+				'',
+			),
+			array(
+				true,
+				'1',
+			),
+			array(
+				array(),
+				'',
+			),
+		);
+	}
 }
Index: /trunk/tests/phpunit/tests/post/walkerPage.php
===================================================================
--- /trunk/tests/phpunit/tests/post/walkerPage.php	(revision 46413)
+++ /trunk/tests/phpunit/tests/post/walkerPage.php	(revision 46413)
@@ -0,0 +1,87 @@
+<?php
+/**
+ * @group post
+ * @group walker
+ */
+class Tests_Post_Walker_Page extends WP_UnitTestCase {
+
+	/**
+	 * @var \Walker_Page The instance of the walker.
+	 */
+	public $walker;
+
+	/**
+	 * Setup.
+	 */
+	public function setUp() {
+		parent::setUp();
+
+		/** Walker_Page class */
+		require_once ABSPATH . 'wp-includes/class-walker-page.php';
+		$this->walker = new Walker_Page();
+	}
+
+	/**
+	 * @ticket 47720
+	 *
+	 * @dataProvider data_start_el_with_empty_attributes
+	 */
+	public function test_start_el_with_empty_attributes( $value, $expected ) {
+		$output = '';
+		$page   = $this->factory->post->create_and_get( array( 'post_type' => 'page' ) );
+		$link   = get_permalink( $page );
+
+		add_filter(
+			'page_menu_link_attributes',
+			function( $atts ) use ( $value ) {
+				$atts['data-test'] = $value;
+				return $atts;
+			}
+		);
+
+		$this->walker->start_el( $output, $page, 0 );
+
+		if ( '' !== $expected ) {
+			$expected = sprintf( ' data-test="%s"', $expected );
+		}
+
+		$this->assertSame( "<li class=\"page_item page-item-{$page->ID}\"><a href=\"{$link}\"{$expected}>{$page->post_title}</a>", $output );
+	}
+
+	public function data_start_el_with_empty_attributes() {
+		return array(
+			array(
+				'',
+				'',
+			),
+			array(
+				0,
+				'0',
+			),
+			array(
+				0.0,
+				'0',
+			),
+			array(
+				'0',
+				'0',
+			),
+			array(
+				null,
+				'',
+			),
+			array(
+				false,
+				'',
+			),
+			array(
+				true,
+				'1',
+			),
+			array(
+				array(),
+				'',
+			),
+		);
+	}
+}
