From 03060ed0203cec59cb8f1973aee29a5b9962a691 Mon Sep 17 00:00:00 2001 From: Mikhail Alferov Date: Wed, 11 Dec 2024 12:44:44 +0300 Subject: [PATCH] count.xml Amend the code example and add return type Return type of Counter::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice --- language/predefined/countable/count.xml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/language/predefined/countable/count.xml b/language/predefined/countable/count.xml index 01237bb027ba..3426c297f245 100644 --- a/language/predefined/countable/count.xml +++ b/language/predefined/countable/count.xml @@ -38,10 +38,13 @@ count; } } @@ -51,6 +54,7 @@ $counter = new Counter; for ($i = 0; $i < 10; ++$i) { echo "I have been count()ed " . count($counter) . " times\n"; } + ?> ]]>