Re: [PHP4BETA] Behaviour not not implemented functions is *unfriendly*
| From: | Stig Bakken | Date: | Mon, 16 Aug 1999 08:23:56 +0000 |
| Subject: | Re: [PHP4BETA] Behaviour not not implemented functions is *unfriendly* | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-3445@lists.php.net to get a copy of this message | ||
On Sun, 15 Aug 1999, Thies C. Arntzen wrote:
> hi,
>
> in link.c (an many other places) we find code like this:
>
> PHP_FUNCTION(readlink)
> {
> #if HAVE_SYMLINK
> pval *filename;
> char buff[256];
> int ret;
>
> ...snip...
>
> /* Append NULL to the end of the string */
> buff[ret] = '\0';
> RETURN_STRING(buff,1);
> #endif
> }
>
> so, if you platform does not have symlinks your not getting anything -
> no warning etc. (very often we have #ifs like this for functions that
> aren't available for win32). i think we should either issue a warning
> if some-function is not implemented or return a "call to undefined
> function" (the later would be harder to implement i suppose).
The latter would only be a matter of wrapping that #if around readlink's
entry in the function table. This is how the same thing is done for a lot
of other functions.
Hope you had an excellent vacation in Gibraltar, Thies :-)
- Stig