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

imap_sort(): Argument #3 ($reverse) #544

Open
Boffice opened this issue Aug 13, 2022 · 1 comment
Open

imap_sort(): Argument #3 ($reverse) #544

Boffice opened this issue Aug 13, 2022 · 1 comment

Comments

@Boffice
Copy link

Boffice commented Aug 13, 2022

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
@Boffice Boffice added the bug label Aug 13, 2022
@Slamdunk
Copy link
Collaborator

That's unexpected, #483 should already have fixed this.

Can you reproduce the bug in a test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants