|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-04-02 00:15 UTC] rdoust at home dot com
$errs = imap_errors();
if ( count( $errs ) > 0 )
printf( "$errs[0] );
This produces an error entry in my PHP log that the parameter I'm sending to count is not an array. I later try gettype() on $errs and I'm told it's a String. I print it's value and it's empty. Does this mean that I have no errors?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Jun 15 14:00:01 2026 UTC |
imap_errors should return an array, from the source of PHP: void php3_imap_errors(INTERNAL_FUNCTION_PARAMETERS) { ERRORLIST *cur=NIL; int arg_count = ARG_COUNT(ht); if (arg_count > 0) { WRONG_PARAM_COUNT; } if (imap_errorstack == NIL) { RETURN_FALSE; } array_init(return_value); cur = imap_errorstack; while (cur != NIL) { add_next_index_string(return_value,cur->LTEXT,1); cur = cur->next; } mail_free_errorlist(&imap_errorstack); imap_errorstack = NIL; } That is why I am going to move this to Misbehaving Functions.If there are no errors, it returns false: if (imap_errorstack == NIL) { RETURN_FALSE; } So, do something that would cause an error, and then call it. You'll get an array.