PHP warning

count(): Parameter must be an array or an object that implements Countable

/home/yz5zbtsx4ic0/domains/pelicanbomb.com/craft/app/vendor/twig/twig/lib/Twig/Extension/Core.php(1275)

1263      * @return int The length of the value
1264      */
1265     function twig_length_filter(Twig_Environment $env, $thing)
1266     {
1267         if (is_scalar($thing)) {
1268             return mb_strlen($thing, $env->getCharset());
1269         }
1270 
1271         if (is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) {
1272             return mb_strlen((string) $thing, $env->getCharset());
1273         }
1274 
1275         return count($thing);
1276     }
1277 
1278     /**
1279      * Converts a string to uppercase.
1280      *
1281      * @param Twig_Environment $env
1282      * @param string           $string A string
1283      *
1284      * @return string The uppercased string
1285      */
1286     function twig_upper_filter(Twig_Environment $env, $string)
1287     {

Stack Trace

#0
+
 /home/yz5zbtsx4ic0/domains/pelicanbomb.com/craft/app/etc/web/WebApp.php(693): CApplication->handleError(2, "count(): Parameter must be an array or an object that implements...", "/home/yz5zbtsx4ic0/domains/pelicanbomb.com/craft/app/vendor/twig...", 1275)
688         if (version_compare(PHP_VERSION, '7.1', '>=') && strpos($message, 'Narrowing occurred during type inference. Please file a bug report') !== false)
689         {
690             return;
691         }
692 
693         parent::handleError($code, $message, $file, $line);
694     }
695 
696     // Private Methods
697     // =========================================================================
698 
#1
+
 /home/yz5zbtsx4ic0/domains/pelicanbomb.com/craft/app/vendor/twig/twig/lib/Twig/Extension/Core.php(1275): Craft\WebApp->handleError(2, "count(): Parameter must be an array or an object that implements...", "/home/yz5zbtsx4ic0/domains/pelicanbomb.com/craft/app/vendor/twig...", 1275, ...)
1270 
1271         if (is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) {
1272             return mb_strlen((string) $thing, $env->getCharset());
1273         }
1274 
1275         return count($thing);
1276     }
1277 
1278     /**
1279      * Converts a string to uppercase.
1280      *
#2
+
 /home/yz5zbtsx4ic0/domains/pelicanbomb.com/craft/storage/runtime/compiled_templates/6c/6c6f977d824d3cd6d237cc5a7bcd5073231f23d2f102e44802d6678adb4083ef.php(73): twig_length_filter(Craft\TwigEnvironment, null)
68             {
69                 // line 24
70                 echo "\t\t\t\t\t\t
71 \t\t\t\t\t\t";
72                 // line 25
73                 if ((twig_length_filter($this->env, $this->getAttribute(($context["entry"] ?? $this->getContext($context, "entry")), "eventEndDate", array())) > 0)) {
74                     // line 26
75                     echo "\t\t\t\t\t\t\t";
76                     if (($this->getAttribute($this->getAttribute(($context["entry"] ?? $this->getContext($context, "entry")), "eventEndDate", array()), "w3c", array(), "method") < $this->getAttribute(($context["now"] ?? $this->getContext($context, "now")), "w3c", array(), "method"))) {
77                         // line 27
78                         echo "\t\t\t\t\t\t\t\t<span class=\"event-past\">This is a past event</span><br>
2024-03-19 02:50:26 Apache / Craft CMS 2.6.2991