2 /* Prototype : string iconv_mime_decode(string encoded_string [, int mode, string charset])
3 * Description: Decodes a mime header field
4 * Source code: ext/iconv/iconv.c
8 * Pass different data types to $str argument to see how iconv_mime_decode() behaves
11 echo "*** Testing iconv_mime_decode() : usage variations ***\n";
13 // Initialise function arguments not being substituted
14 $header = b
'Subject: =?UTF-8?B?UHLDvGZ1bmcgUHLDvGZ1bmc=?=';
15 $mode = ICONV_MIME_DECODE_CONTINUE_ON_ERROR
;
19 //get an unset variable
26 public function __toString() {
27 return "Class A object";
36 // get a resource variable
37 $fp = fopen(__FILE__
, "r");
39 // unexpected values to be passed to $str argument
78 /*22*/ @$undefined_var,
87 // loop through each element of $inputs to check the behavior of iconv_mime_decode()
89 foreach($inputs as $input) {
90 echo "\n-- Iteration $iterator --\n";
91 try { var_dump( bin2hex(iconv_mime_decode($header, $input, $charset))); } catch (Exception
$e) { echo "\n".'Warning: '.$e->getMessage().' in '.__FILE__
.' on line '.__LINE__
."\n"; }