Clarification required for "image_type_to_mime_type" function

From: Date: Wed, 30 Apr 2008 07:13:27 +0000
Subject: Clarification required for "image_type_to_mime_type" function
Groups: php.qa 
Request: Send a blank email to php-qa+get-64246@lists.php.net to get a copy of this message
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

« previous php.qa (#64246) next »