From: mans at agoodid dot com
Operating system: Linux i686
PHP version: 4.3.2
PHP Bug Type: ICONV related
Bug description: iconv() function disappears and reappears at random times

Description:
------------
For some reason, PHP reports:

Call to undefined function: iconv()

from time to time. A little later, the function will work without a hitch,
without any changes being made to the PHP configuration.

Configure command is:

'./configure' '--with-kerberos' '--with-openssl' '--prefix=/usr/local'
'--with-mysql=/usr' '--with-gd' '--with-imap' '--with-imap-ssl'
'--with-xml' '--with-zlib' '--enable-bcmath'
'--with-apxs=/usr/local/apache/bin/apxs' '--enable-track-vars'
'--enable-versioning' '--with-ldap' '--with-mcrypt' '--with-mhash'
'--with-pdflib=/usr' '--enable-shared-pdflib' '--with-swf' '--with-ttf'
'--with-t1lib' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx'
'--enable-memory-limit' '--enable-dbase' '--enable-ftp' '--with-curl'

Reproduce code:
---------------
Code which generates the error, but later works fine:

function mime_decode($s) {
$elements = imap_mime_header_decode($s);
for($i = 0;$i < count($elements);$i++) {
$cht = $elements[$i]->cht;
$text =$elements[$i]->text;
if(!strcasecmp($cht, "utf-8") ||
!strcasecmp($cht, "utf-7"))
{
$text = iconv($cht, "iso-8859-1", $text);
}
$decoded = $decoded . $text;
}
return $decoded;
}

Note: The indata does not change either - same code with same data works
fine from time to time - at other times not. Can't see any pattern to when
it works and when it doesn't.

Expected result:
----------------
$text converted into iso-8859-1 format from UTF-8.

Actual result:
--------------
Call to undefined function: iconv()

--
Edit bug report at [url]http://bugs.php.net/?id=25509&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=25509&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=25509&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=25509&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=25509&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=25509&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=25509&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=25509&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=25509&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=25509&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=25509&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=25509&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=25509&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=25509&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=25509&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=25509&r=gnused[/url]