PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » PHP » PHP_Compat » Bug #2266

image_type_to_mime_type : bad redeclaration of constants

Details

Submitted2004-09-01 14:56 UTC
Fromfrederic dot poeydomenge at free dot fr
Assignedaidan
StatusClosed
PackagePHP_Compat
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2004-09-01 14:56 UTC] frederic dot poeydomenge at free dot fr

Description:
------------
All the constants in $PEAR/PHP/Compat/Function/image_type_to_mime_type.php are redeclared with a bad value (minus 1)

See the snippet of code at :
http://www.php.net/manual/en/function.image-type-to-mime-type.php

Reproduce code:
---------------
echo
'IMAGETYPE_GIF:'.IMAGETYPE_GIF."\n".
'IMAGETYPE_JPEG:'.IMAGETYPE_JPEG."\n".
'IMAGETYPE_PNG:'.IMAGETYPE_PNG."\n".
'IMAGETYPE_SWF:'.IMAGETYPE_SWF."\n".
'IMAGETYPE_PSD:'.IMAGETYPE_PSD."\n";

Expected result:
----------------
IMAGETYPE_GIF:1
IMAGETYPE_JPEG:2
IMAGETYPE_PNG:3
IMAGETYPE_SWF:4
IMAGETYPE_PSD:5

Actual result:
--------------
IMAGETYPE_GIF:0
IMAGETYPE_JPEG:1
IMAGETYPE_PNG:2
IMAGETYPE_SWF:3
IMAGETYPE_PSD:4