php-imap2 icon indicating copy to clipboard operation
php-imap2 copied to clipboard

Does not work with php8.1

Open GolfSierra opened this issue 3 years ago • 4 comments

https://www.php.net/manual/en/function.imap-open.php : 8.1.0 | Returns an IMAP\Connection instance now; previously, a resource was returned. several test sof resource type are performed and now return false in php8.1

GolfSierra avatar Aug 24 '22 18:08 GolfSierra

Support for PHP 8.1 was planned for the next year! Feel free to ask me anythings.

francescobianco avatar Sep 15 '22 15:09 francescobianco

I'd like to follow-up on this. Does the package support PHP 8.1 yet? We've come to rely on the library and are hoping to use it under v8.1.

cjwnz avatar Nov 13 '23 02:11 cjwnz

Update: Got it working under PHP 8.1 by replacing all instances in code of: is_resource($imap) && get_resource_type($imap) == 'imap'

with: is_a($imap,'IMAP\Connection')

cjwnz avatar Nov 13 '23 03:11 cjwnz

I'm confused, as for us it seems to work with PHP8.1. Except we sometimes get this error and I wonder if it's related:

Argument #1 ($stream) must be of type resource, null given {"exception":"[object] (TypeError(code: 0): fclose( ): Argument #1 ($stream) must be of type resource, null given at /.../php-imap2/src/Roundcube/ImapClient.php:442

What errors did you get @cjwnz ?

fishbone1 avatar Apr 19 '24 07:04 fishbone1