Re: Clarification required for "image_type_to_mime_type" function
| From: | Sanjay Mantoor | Date: | Thu, 01 May 2008 15:15:06 +0000 |
| Subject: | Re: Clarification required for "image_type_to_mime_type" function | ||
| References: | 1 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-64255@lists.php.net to get a copy of this message | ||
Pierre,
Any comments for below?
Thanks,
Sanjay M
On Wed, Apr 30, 2008 at 12:43 PM, Sanjay Mantoor
<sanjay.mantoor@gmail.com> wrote:
> Pierre,
>
> While writing tests for "image_type_to_mime_type" function I
> encountered few issues. I tested with latest build of date
> 200804290630.
> Can you please clarify my doubts on following
>
> 1. image_type_to_mime_type(IMAGETYPE_ICO) :
> As per document
>
> http://in2.php.net/manual/en/function.image-type-to-mime-type.php it
> should return "image/vnd.microsoft.icon"
> This is working for PHP5.3 and PHP6.0 version but not with PHP5.2.
>
> 2.image_type_to_mime_type($value) when $value is either of following
>
> array(),
>
> array('color' => 'red', 'item' =>
> 'pen'),
>
> "",
>
> '',
>
> "string",
>
> 'string',
>
> new MyClass()
>
> In above case it is working as expected for PHP5.2 and PHP5.3 but not for PHP6.
> For PHP6 it throws following message
> Warning: image_type_to_mime_type() expects parameter 1 to be long,
> string given in test.php on line 2
> NULL
> As per my understanding when above values is type-cast to int , either
> it should be 0 or 1 and hence return value should be
> "application/octet-stream" or "image/gif"
>
> --
> Thanks,
> Sanjay Mantoor
>
--
Thanks,
Sanjay Mantoor