1--TEST-- 2Test image_type_to_mime_type() function : usage variations - Pass decimal, octal, and hexadecimal values as imagetype 3--FILE-- 4<?php 5echo "*** Testing image_type_to_mime_type() : usage variations ***\n"; 6 7error_reporting(E_ALL ^ E_NOTICE); 8$values = array ( 9 //Decimal values 10 0, 11 1, 12 12345, 13 -12345, 14 15 //Octal values 16 02, 17 010, 18 030071, 19 -030071, 20 21 //Hexadecimal values 22 0x0, 23 0x1, 24 0xABCD, 25 -0xABCD 26); 27 28// loop through each element of the array for imagetype 29$iterator = 1; 30foreach($values as $value) { 31 echo "\n-- Iteration $iterator --\n"; 32 var_dump( image_type_to_mime_type($value) ); 33 $iterator++; 34}; 35?> 36--EXPECT-- 37*** Testing image_type_to_mime_type() : usage variations *** 38 39-- Iteration 1 -- 40string(24) "application/octet-stream" 41 42-- Iteration 2 -- 43string(9) "image/gif" 44 45-- Iteration 3 -- 46string(24) "application/octet-stream" 47 48-- Iteration 4 -- 49string(24) "application/octet-stream" 50 51-- Iteration 5 -- 52string(10) "image/jpeg" 53 54-- Iteration 6 -- 55string(10) "image/tiff" 56 57-- Iteration 7 -- 58string(24) "application/octet-stream" 59 60-- Iteration 8 -- 61string(24) "application/octet-stream" 62 63-- Iteration 9 -- 64string(24) "application/octet-stream" 65 66-- Iteration 10 -- 67string(9) "image/gif" 68 69-- Iteration 11 -- 70string(24) "application/octet-stream" 71 72-- Iteration 12 -- 73string(24) "application/octet-stream" 74