diff --git a/include/utils/VtlibUtils.php b/include/utils/VtlibUtils.php
index df65533d62754bef82cd7406c897f293eae87046..d34eb446f2c0625d10f68c4e23b997137317c17b 100644
--- a/include/utils/VtlibUtils.php
+++ b/include/utils/VtlibUtils.php
@@ -962,8 +962,10 @@ if (!function_exists('get_magic_quotes_gpc')) {
 }
 
 function php7_count($value) {
-	// PHP 8.x does not like count(null) or count(string)
-	return is_null($value) || !is_array($value) ? 0 : count($value);
+	// PHP 8.x does not allow count(null) or count(string)
+	if (is_null($value)) return 0;
+	if (!is_array($value)) return 1;
+	return count($value);
 }
 
 ?>