ID:               33039
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mpb dot mail at gmail dot com
 Status:           Bogus
 Bug Type:         IMAP related
 Operating System: *
 PHP Version:      5.*, 4.*
 Assigned To:      sniper
 New Comment:

I think the key point here is that imap_errors() should be called after
doing the imap_open(), which would clear the error stack and stop PHP
throwing E_NOTICEs.

This isn't very clear in the manual, which is arguably a doc bug.


Previous Comments:
------------------------------------------------------------------------

[2005-05-19 15:38:41] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

On request termination PHP flushes all not yet reported IMAP errors at
E_NOTICE error reporting level. The fact there are any is the result of
the IMAP library reporting them.

------------------------------------------------------------------------

[2005-05-16 08:35:15] mpb dot mail at gmail dot com

Description:
------------
If you imap_open an empty pop mailbox, a "Mailbox is empty (errflg=1)"
notice will be printed during PHP's "shutdown" or "cleanup" phase after
your script has finished running (assuming E_NOTICE is set, of course).

As there is nothing wrong with having an empty mailbox, I believe that
PHP should not print this notice.  I suspect that PHP is misinterpreting
a return code from the IMAP library, or is making an unnecessary call to
the IMAP library.  It is also possible that the IMAP library is buggy
and should not be returning an errflg=1 (whatever that means).

If, in the reproduce code, you uncomment the final ini_set then the
notice will not be printed (as E_NOTICE is no longer set during PHP's
shutdown).

If you are unable to reproduce this problem with the empty POP mailbox
of your choice, let me know and I will set up a POP mailbox for you to
test against.

See also bug 7207.

Reproduce code:
---------------
ini_set ('error_reporting', E_ALL);

$imap = imap_open
  ( '{host.com:110/pop/novalidate-cert}INBOX',
    'user', 'password' );

trigger_error ('test notice');

sleep (5);

// ini_set ('error_reporting', E_ALL ^ E_NOTICE);


Expected result:
----------------
Notice: test notice in /root/pinstall/local/vl0/test.php on line 8


Actual result:
--------------
Notice: test notice in /root/pinstall/local/vl0/test.php on line 8

Notice: Unknown: Mailbox is empty (errflg=1) in Unknown on line 0



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33039&edit=1

Reply via email to