diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php
index dc0dfe7ef0..14e0cca45b 100644
--- a/src/wp-includes/category-template.php
+++ b/src/wp-includes/category-template.php
@@ -1087,7 +1087,7 @@ function _wp_object_name_sort_cb( $a, $b ) {
  * @return bool Whether the count value for `$a` is greater than the count value for `$b`.
  */
 function _wp_object_count_sort_cb( $a, $b ) {
-	return ( $a->count > $b->count );
+	return ( $a->count <=> $b->count );
 }
 
 //
