Re: function_exists() user note

From: Date: Mon, 27 Nov 2000 11:48:16 +0000
Subject: Re: function_exists() user note
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-39235@lists.php.net to get a copy of this message
Jani Taskinen wrote: > You could always use imagetypes() function to check which image-types > are supported. But to be consistent the functions shouldn't be defined if > the imagetype isn't supported, IMHO. > > Should this be changed or not? i changed it the other way out some time ago as a lot of people seemed to have problems with functions not being available although they had compiled the appropriate extension in IMHO the availability of a function should only depend on whether an extension is enabled or not, every function within an extension that does not work due to a missing or unsupported feature should produce a warning and return something that indicates an error condition that's the way things are today and from my personal perceptions it seems to work as i haven't seen any "i have gd compiled in but ImageGif() reports 'undefined function ...'" messages lately so function_exists() should not be used to determine the availability of a feature within an extension but only to detect whether an extesnion as a whole is there or not or to check for the right version of an extension any extension that provides features and functions not working in any constellation should provide other means to report so, as gd does with imagetypes() -- Hartmut Holzgraefe hartmut@six.de http://www.six.de +49-711-99091-77

« previous php.dev (#39235) next »