Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zend_Cache_Frontend_Page #121

Closed
richardsalvaia opened this issue Dec 6, 2020 · 4 comments
Closed

Zend_Cache_Frontend_Page #121

richardsalvaia opened this issue Dec 6, 2020 · 4 comments

Comments

@richardsalvaia
Copy link

Hello,

Need to test if variable is_array before test it with count. The error:

if (count($var) > 0) {

Uncaught Exception: count(): Parameter must be an array or an object that implements Countable in /vendor/shardj/zf1-future/library/Zend/Cache/Frontend/Page.php:3982.

Stack trace:
#0 vendor/shardj/zf1-future/library/Zend/Cache/Frontend/Page.php(398): RS_Error_Handler::handle()
#1 vendor/shardj/zf1-future/library/Zend/Cache/Frontend/Page.php(346): Zend_Cache_Frontend_Page->_makePartialId()
#2 vendor/shardj/zf1-future/library/Zend/Cache/Frontend/Page.php(264): Zend_Cache_Frontend_Page->_makeId()
#3 application/Bootstrap.php(135): Zend_Cache_Frontend_Page->start()

@ferranbonas
Copy link

The error has been there since 7.2. Fix:

if ($var && count($var) > 0) {
            return false;
}

@richardsalvaia
Copy link
Author

Yes, another approach is:

if (is_array($var) && count($var) > 0) {
return false;
}

@Shardj
Copy link
Owner

Shardj commented Dec 11, 2020

Just committed a fix

@Shardj Shardj closed this as completed Dec 11, 2020
@Shardj
Copy link
Owner

Shardj commented Dec 11, 2020

Release tag with fix: release-1.18.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants