Joomla 4.1 PHP 8.0-8.1
count($not_array);
When switching to version 7.4, the following warning is issued.
Warning
: count(): Parameter must be an array or an object that implements Countable in
/home/Rigin/web/gaz.rigin.net/public_html/components/com_cabinet/router.php
on line
150
When working on PHP 8.0-8.1
A message is issued without specifying the location of the error:
0 count(): Argument #1 ($value) must be of type Countable|array, bool given
I asked this question on the php support forum, https://github.com/php/php-src/issues/9198, but they refer to the incorrect operation of the interrupt handler in the program.
Labels |
Added:
No Code Attached Yet
|
As long as Joomla shows you the complete call stack when having debug system switched on in global configuration, I see no issue here. Is this the case, do you see the call stack if you have switched on debug?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-07-30 10:31:24 |
Closed_By | ⇒ | Fedik |
That is expected behavior for count($not_countable)
:
php <= 7.4 will show a Warnning
php => 8 will throw an Exception
If you want to see full trace for an Exception then set debug=on in global configuration, you will get a full trace that will show what is cause this exception.
@rigin They refer to an exception handler. An interrupt handler is something completely different, and you using that term in your issue there confused them maybe so they assumed you are using some kind of a library working with interrupts.
Besides that, your link to that issue does not work. It shows the right URL as link text, but the link goes to https://github.com/joomla/joomla-cms/issues/url .