No Code Attached Yet
avatar rigin
rigin
29 Jul 2022

Steps to reproduce the issue

Joomla 4.1 PHP 8.0-8.1

count($not_array);

Expected result

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

Actual result

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

System information (as much as possible)

Additional comments

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.

avatar rigin rigin - open - 29 Jul 2022
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jul 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Jul 2022
avatar rigin rigin - change - 29 Jul 2022
The description was changed
avatar rigin rigin - edited - 29 Jul 2022
avatar richard67
richard67 - comment - 30 Jul 2022

but they refer to the incorrect operation of the interrupt handler in the program.

@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 .

avatar richard67
richard67 - comment - 30 Jul 2022

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?

avatar Fedik Fedik - change - 30 Jul 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-07-30 10:31:24
Closed_By Fedik
avatar Fedik Fedik - close - 30 Jul 2022
avatar Fedik
Fedik - comment - 30 Jul 2022

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.

Add a Comment

Login with GitHub to post a comment