barbushin / php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)
MIT License
1.65k stars 459 forks source link

#624: Provide PHP 8.1 compatibility #644

Closed MaSpeng closed 2 years ago

MaSpeng commented 2 years ago

This pull request will provide compatibility with PHP 8.1.

Closes #624

nunoperalta commented 2 years ago

Nice! I'm actually just waiting for this package to get 8.1 support, to be able to drop 7.4 ​😊👍 Thank you!

Sebbo94BY commented 2 years ago

What's the reason for replacing all PHP mb_ functions with imap_utf7_?

Is this also backward compatible or does it break in any PHP version?

MaSpeng commented 2 years ago

@Sebi94nbg The reason for the exchange of the mb_ functions with the imap_utf7_functions where the encoding decoding issues which arises with PHP 8.1 and they are the native solution for encoding and decoding contents for IMAP, afaik.

Regarding compatibility, the imap_utf7_ functions are available since PHP 4.

I successfully ran the unit tests using PHP with versions 7.2.34, 7.3.33, 7.4.26, 8.0.13, 8.1.0.