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

PHP 8.1 throws errors in development mode #203

Open
jakeparis opened this issue Nov 7, 2022 · 3 comments
Open

PHP 8.1 throws errors in development mode #203

jakeparis opened this issue Nov 7, 2022 · 3 comments

Comments

@jakeparis
Copy link
Contributor

As far as I can tell, the site works ok on php 8.1. However, there are quite a few errors showing in development mode that are noteworthy. For example:

Message: Return type of phpseclib_mcrypt_filter::filter($in, $out, &$consumed, $closing) should either be compatible with php_user_filter::filter($in, $out, &$consumed, bool $closing): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: phpseclib/mcrypt.php
Line Number: 1104

Message: Return type of phpseclib_mcrypt_filter::onCreate() should either be compatible with php_user_filter::onCreate(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: phpseclib/mcrypt.php
Line Number: 1155

Message: Return type of phpseclib_mcrypt_filter::onClose() should either be compatible with php_user_filter::onClose(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Filename: phpseclib/mcrypt.php
Line Number: 1218

Message: mysqli::query(): Passing null to parameter #2 ($result_mode) of type int is deprecated
Filename: Adapter/MysqliDbExtended.php
Line Number: 108

Message: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated
Filename: models/user_model.php
Line Number: 767
@jakeparis jakeparis changed the title PHP 8.1 throws many errors in development mode PHP 8.1 throws errors in development mode Nov 7, 2022
@ravenspace
Copy link

Is there a work around for this issue? I can fend off the mcrypt issue, but the "passing null" has me stumped.

@craigdietrich
Copy link
Collaborator

I just booted up Scalar on a server with PHP 8.2 and I get a ton of warnings.

For now, you might be able to get away with the warnings by simply changing 'development' to 'production' in:

scalar root/codeigniter.php

If that doesn't work, you probably will get blank white screens in Scalar books?

I'm going to work on getting these warnings cleared out now.

@craigdietrich
Copy link
Collaborator

Hi all,

I finished the PHP 8 work and pushed the commit to master/main ( a841ee6 ). Now, at least on my end, there are no more PHP warnings/errors except for the three mcrrypt warnings. I was under the impression than mcrypt was going to be removed from PHP altogether so we wouldn't have to worry about those warnings anymore. FWIW, Scalar is set up to roll to another encryption package should mcrypt not be available.

To remove the mcrypt warnings simply set "development" to "production" in /codeigniter.php

Note that I also updated the ARC2 package, which requires PHP 8, so now Scalar itself has to require PHP 8 with this update.

Can you test by updating from master/main and seeing if you can reproduce the results?

Thansk!

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