cvs: ZendEngine2(PHP_5_3) / zend_API.c
"Felipe Pena" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.zend |
|---|---|
| Message-ID | <cvsfelipe1212691986@cvsserver> |
felipe Thu Jun 5 18:53:06 2008 UTC
Modified files: (Branch: PHP_5_3)
/ZendEngine2 zend_API.c
Log:
- Fixed bug #45186 (__call depends on __callstatic in class scope)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.296.2.27.2.34.2.37&r2=1.296.2.27.2.34.2.38&diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.296.2.27.2.34.2.37 ZendEngine2/zend_API.c:1.296.2.27.2.34.2.38
--- ZendEngine2/zend_API.c:1.296.2.27.2.34.2.37 Tue May 27 10:29:33 2008
+++ ZendEngine2/zend_API.c Thu Jun 5 18:53:06 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.296.2.27.2.34.2.37 2008/05/27 10:29:33 mattwil Exp $ */
+/* $Id: zend_API.c,v 1.296.2.27.2.34.2.38 2008/06/05 18:53:06 felipe Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -2392,14 +2392,27 @@
if (*zobj_ptr_ptr && *ce_ptr && (*ce_ptr)->__call != 0) {
retval = (*ce_ptr)->__call != NULL;
*fptr_ptr = (*ce_ptr)->__call;
- } else if (!*zobj_ptr_ptr && *ce_ptr && (*ce_ptr)->__callstatic) {
- retval = 1;
- *fptr_ptr = (*ce_ptr)->__callstatic;
} else {
- if (*ce_ptr) {
- if (error) zend_spprintf(error, 0, "class '%s' does not have a method '%s'", (*ce_ptr)->name, lmname);
- } else {
- if (error) zend_spprintf(error, 0, "function '%s' does not exist", lmname);
+ if (!*zobj_ptr_ptr && *ce_ptr && ((*ce_ptr)->__callstatic || (*ce_ptr)->__call)) {
+ if ((*ce_ptr)->__call &&
+ EG(This) &&
+ Z_OBJ_HT_P(EG(This))->get_class_entry &&
+ instanceof_function(Z_OBJCE_P(EG(This)), *ce_ptr TSRMLS_CC)) {
+ retval = 1;
+ *fptr_ptr = (*ce_ptr)->__call;
+ *zobj_ptr_ptr = &EG(This);
+ } else if ((*ce_ptr)->__callstatic) {
+ retval = 1;
+ *fptr_ptr = (*ce_ptr)->__callstatic;
+ }
+ }
+
+ if (retval == 0) {
+ if (*ce_ptr) {
+ if (error) zend_spprintf(error, 0, "class '%s' does not have a method '%s'", (*ce_ptr)->name, lmname);
+ } else {
+ if (error) zend_spprintf(error, 0, "function '%s' does not exist", lmname);
+ }
}
}
} else {
--
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php