Bug #77082 [NEW]: Sequential imap_status returns previous folders totals

From: Date: Tue, 30 Oct 2018 00:39:09 +0000
Subject: Bug #77082 [NEW]: Sequential imap_status returns previous folders totals
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217744@lists.php.net to get a copy of this message
From: shafer_w2002 at yahoo dot com Operating system: PHP version: 7.2.11 Package: IMAP related Bug Type: Bug Bug description:Sequential imap_status returns previous folders totals Description: ------------ This bug is affecting 7.2.11 and 7.3.0RC4 If calling imap_status() on a series of mailboxes, if the mailbox has no emails in it, imap_status() returns the previous result. I have also tried calling imap_gc() before calling imap_status() and this didn't help either. Test script: --------------- $folders = [ '{localhost:143}INBOX', // Has 3 emails, 2 unseen '{localhost:143}INBOX/NoEmails', // Has no emails ]; $connection = imap_open('{localhost:143}INBOX/NoEmails', 'user', 'password); foreach ($folders as $folder) { $status = imap_status($connection, $folder, SA_ALL); // Changing options has no effect on the result print_r($status); // Always returns the results for INBOX } Expected result: ---------------- stdClass Object ( [flags] => 31 [messages] => 3 [recent] => 0 [unseen] => 2 [uidnext] => 1108 [uidvalidity] => 1527875182 ) stdClass Object ( [flags] => 31 [messages] => 0 [recent] => 0 [unseen] => 0 [uidnext] => 1108 [uidvalidity] => 1527875182 ) Actual result: -------------- stdClass Object ( [flags] => 31 [messages] => 3 [recent] => 0 [unseen] => 2 [uidnext] => 1108 [uidvalidity] => 1527875182 ) stdClass Object ( [flags] => 31 [messages] => 3 [recent] => 0 [unseen] => 2 [uidnext] => 1108 [uidvalidity] => 1527875182 ) -- Edit bug report at https://bugs.php.net/bug.php?id=77082&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77082&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77082&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77082&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=77082&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=77082&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=77082&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=77082&r=needscript Try newer version: https://bugs.php.net/fix.php?id=77082&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=77082&r=support Expected behavior: https://bugs.php.net/fix.php?id=77082&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=77082&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=77082&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=77082&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77082&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=77082&r=dst IIS Stability: https://bugs.php.net/fix.php?id=77082&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=77082&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=77082&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=77082&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=77082&r=mysqlcfg

« previous php.bugs (#217744) next »