barbushin / php-imap

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

Fix imap_sort() for PHP < 8.0 #660

Closed marios88 closed 2 years ago

marios88 commented 2 years ago

Getting the following error on PHP versions lower than 8.0

Uncaught TypeError: imap_sort() expects parameter 3 to be int, bool given

Since PHP 8.0.0 reverse is now bool instead of int https://www.php.net/manual/en/function.imap-sort.php

alebedev80 commented 2 years ago

Hi @marios88 I've created PR https://github.com/barbushin/php-imap/pull/659 about same issue two days ago but it looks like the main contributors have abandoned the project ;(

mattyhansen commented 2 years ago

@barbushin @rmontagud @Theaxiom @hexathos @JellyBellyDev @alebedev80

The following commit from 4.3.0 is causing this "imap_sort() expects parameter 3 to be int, bool given" error:

https://github.com/barbushin/php-imap/commit/2cd5d0bcf4500f4cc70559a103d65a72b512700b

image

JellyBellyDev commented 2 years ago

sorry but I am not one of the maintainers, a long time ago I contributed a PR but I have no power over this repo. good luck

rmontagud commented 2 years ago

As @JellyBellyDev I just contributed a PR and have no power over this repo, but this is an issue i will face eventually when I have to upgrade to PHP8.x

marios88 commented 2 years ago

Hi @marios88 I've created PR #659 about same issue two days ago but it looks like the main contributors have abandoned the project ;(

Really sorry, i didn't notice, am closing this since your PR https://github.com/barbushin/php-imap/pull/659 fixes the same problem