[patch] Separating ZEND_METHOD and ZEND_FUNCTION
| From: | Johannes Schlueter | Date: | Fri, 03 Mar 2006 22:30:00 +0000 |
| Subject: | [patch] Separating ZEND_METHOD and ZEND_FUNCTION | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-22103@lists.php.net to get a copy of this message | ||
Hi,
following a recent discussion on IRC I'd like to propose a little patch
separating ZEND_FUNCTION and ZEND_METHOD.
Currently functions declared as ZEND_FUNCTION are named zif_exported_name.
Class methods are exported as zif_class_method. If you try to create a PHP
function called foo_bar but already have some class foo with a method bar
this leads to a "redefinition of
Attachment: [text/x-diff] zend_separate_zend_method.diff
zif_foo_bar".
The attached patch solves this kind of issues by prefixing methods with zim_
(with m like in method) instead of zif_.
Additionally it might help a bit while debugging since you can see wether
you're in some class/object or a function context.
As always the patch is also available at my repository on
http://svn.schlueters.de/phpatches/HEAD/zend_separate_zend_method.diff
johannes
Attachment: [text/x-diff] zend_separate_zend_method.diff