from a support perspective, it might be nice to have a
quasi-implemented type of function that returns false for
function_exists but if the function is actually called, it would
return an error like imagecopyresampled() does (that is, a more
specific error than "function not supported"). that would help cut
down on bug reports about unsupported functions, i think.
(but given the option of the function not existing at all, or the
current behavior of functions like imagecopyresampled(), i'd prefer
the function not exist when it won't work so that smart people can
work around it with function_exists().)
jim
Stig Bakken <[EMAIL PROTECTED]> wrote:
> yes it would be better to not define it. that has been "the way" in php 3
> and 4. only back in v2 we had those "blah is not enabled" messages.
>
> - Stig
>
> On Tue, 10 Jul 2001, Jeremy Bettis wrote:
>
>> Why is the habit of PHP modules to define functions that might or might not
>> work depending on library dependancies.
>>
>> For example, ImageCopyResampled gives this error if libgd < 2.0:
>> "ImageCopyResampled required libgd 2.0"
>>
>> But that makes this code useless:
>>
>> if (function_exists('ImageCopyResampled')) {
>> // doit the good way
>> ImageCopyResampled(.....);
>> } else {
>> ImageCopyResized(.....);
>> }
>>
>> My point was to have the php script work regardless of what version of php
>> was installed, but even if the function exists, it might not work. Wouldn't
>> it have been better if the function just didn't exist at all?
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]