1--TEST-- 2image_type_to_mime_type() (passinf equivalent integer values) 3--CREDITS-- 4Sanjay Mantoor <sanjay.mantoor@gmail.com> 5--FILE-- 6<?php 7/* Prototype : string image_type_to_mime_type(int imagetype) 8 * Description: Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype 9 * Source code: ext/standard/image.c 10 */ 11 12echo "*** Testing image_type_to_mime_type() : usage variations ***\n"; 13 14for($imagetype = 0; $imagetype <= IMAGETYPE_COUNT; ++$imagetype) { 15 echo "\n-- Iteration $imagetype --\n"; 16 var_dump(image_type_to_mime_type($imagetype)); 17} 18?> 19===DONE=== 20--EXPECTREGEX-- 21\*\*\* Testing image_type_to_mime_type\(\) : usage variations \*\*\* 22 23-- Iteration 0 -- 24string\(24\) "application\/octet-stream" 25 26-- Iteration 1 -- 27string\(9\) "image\/gif" 28 29-- Iteration 2 -- 30string\(10\) "image\/jpeg" 31 32-- Iteration 3 -- 33string\(9\) "image\/png" 34 35-- Iteration 4 -- 36string\(29\) "application\/x-shockwave-flash" 37 38-- Iteration 5 -- 39string\(9\) "image\/psd" 40 41-- Iteration 6 -- 42string\(14\) "image\/x-ms-bmp" 43 44-- Iteration 7 -- 45string\(10\) "image\/tiff" 46 47-- Iteration 8 -- 48string\(10\) "image\/tiff" 49 50-- Iteration 9 -- 51string\(24\) "application\/octet-stream" 52 53-- Iteration 10 -- 54string\(9\) "image\/jp2" 55 56-- Iteration 11 -- 57string\(24\) "application\/octet-stream" 58 59-- Iteration 12 -- 60string\(24\) "application\/octet-stream" 61 62-- Iteration 13 -- 63string\(2[49]\) "application\/(x-shockwave-flash|octet-stream)" 64 65-- Iteration 14 -- 66string\(9\) "image\/iff" 67 68-- Iteration 15 -- 69string\(18\) "image\/vnd.wap.wbmp" 70 71-- Iteration 16 -- 72string\(9\) "image\/xbm" 73 74-- Iteration 17 -- 75string\(24\) "image\/vnd.microsoft.icon" 76 77-- Iteration 18 -- 78string\(24\) "application\/octet-stream" 79===DONE=== 80