imap
imap copied to clipboard
imap_sort(): Argument #3 ($reverse)
| Q | A |
|---|---|
| ddeboer/imap version | 1.14.0 |
| PHP version | PHP 8.0.22 |
Summary
$today = new DateTimeImmutable();
$thirtyDaysAgo = $today->sub(new DateInterval('P2D'));
$messages = $mailbox->getMessages(
new Ddeboer\Imap\Search\Date\Since($thirtyDaysAgo),
\SORTDATE, // Sort criteria
true // Descending order
);
Above code worked fine on php 7.4 but on php 8 i get the error:
An uncaught Exception was encountered
Type: TypeError
Message: imap_sort(): Argument #3 ($reverse) must be of type bool, int given
Filename: /var/www/public_html/crm/application/vendor/ddeboer/imap/src/Mailbox.php
Line Number: 172
That's unexpected, https://github.com/ddeboer/imap/pull/483 should already have fixed this.
Can you reproduce the bug in a test?