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

PHP8 compatibility with sending mail #54

Open
Monica-Wood opened this issue Feb 2, 2023 · 0 comments
Open

PHP8 compatibility with sending mail #54

Monica-Wood opened this issue Feb 2, 2023 · 0 comments

Comments

@Monica-Wood
Copy link

I am using PHP 8.1 and receiving the following error when sending mail.

Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, Zend_Registry given in /var/www/ca/vendor/magento/zendframework1/library/Zend/Registry.php:207

The way array_key_exists has changed in php 8

For backward compatibility reasons, array_key_exists() will also return true if key is a property defined within an object given as array. This behaviour is deprecated as of PHP 7.4.0, and removed as of PHP 8.0.0.

Since the bit of code that is causing the TypeError was put into place to fix a previous bug, I have commented out the entire offsetExists() function in Registry.php so it would fall back to the function in ArrayObject.

Mail is now sending successfully with this function commented out.

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

1 participant