Re: Is there any value in having functions defined which do nothing.

From: Date: Tue, 10 Jul 2001 21:45:58 +0000
Subject: Re: Is there any value in having functions defined which do nothing.
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-59628@lists.php.net to get a copy of this message
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 <Stig.Bakken@fast.no> 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?

« previous php.dev (#59628) next »