Re: function registration patch
| From: | Derick Rethans | Date: | Tue, 18 Mar 2003 21:57:01 +0000 |
| Subject: | Re: function registration patch | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-93@lists.php.net to get a copy of this message | ||
On Tue, 18 Mar 2003, Andrei Zmievski wrote:
> Currently when registering functions, the unmodified function name is
> used as the key for the function table. This leads to problems when an
> extension class has a constructor that is not all lowercased. For
> example:
>
> function_entry php_gtk_button_functions[] = {
> PHP_FE("GtkButton", NULL),
> ...
> };
>
> Then when using something like:
>
> ...
> parent::GtkButton();
> ...
>
> It fails because it uses 'gtkbutton' as the key to search the function
> table. The attached patch fixes that by lowercasing the key (function
> name) when registering functions.
>
> I know that some may say, "just use lowercase class name for the
> constructor in the function entry list", but that messes with nice
> class/function names again.
Maybe we can finally fix the OO model and just make them case-sensitive? :)
If that's not an option, I think the patch is OK.
Derick
--
"my other box is your windows PC"
-------------------------------------------------------------------------
Derick Rethans http://derickrethans.nl/
PHP Magazine - PHP Magazine for Professionals http://php-mag.net/
-------------------------------------------------------------------------