Index: wp-includes/class-wp-walker.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/class-wp-walker.php	(date 1496664043000)
+++ wp-includes/class-wp-walker.php	(date 1496777765000)
@@ -47,6 +47,14 @@
 	 */
 	public $has_children;
 
+	/**
+	 * Total children of current element.
+	 *
+	 * @since 4.7.2
+	 * @var bool
+	 */
+	public $total_children;
+
 	/**
 	 * Starts the list before the elements are added.
 	 *
@@ -142,6 +150,11 @@
 			$args[0]['has_children'] = $this->has_children; // Back-compat.
 		}
 
+		$this->total_children = 0;
+		if ( $this->has_children ) {
+			$this->total_children = count( $children_elements[ $id ] );
+		}
+
 		$cb_args = array_merge( array(&$output, $element, $depth), $args);
 		call_user_func_array(array($this, 'start_el'), $cb_args);
 
@@ -404,8 +417,6 @@
 	/**
 	 * Unset all the children for a given top level element.
 	 *
-	 * @since 2.7.0
-	 *
 	 * @param object $e
 	 * @param array $children_elements
 	 */
