cvs: ZendEngine2 / zend_object_handlers.c
| From: | Marcus Boerger | Date: | Tue, 02 Dec 2003 22:08:51 +0000 |
| Subject: | cvs: ZendEngine2 / zend_object_handlers.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2050@lists.php.net to get a copy of this message | ||
helly Tue Dec 2 17:08:51 2003 EDT
Modified files:
/ZendEngine2 zend_object_handlers.c
Log:
Remove automatic call to __toString() since it is supposed to cause too
much trouble. See discussion on the mailing list.
Index: ZendEngine2/zend_object_handlers.c
diff -u ZendEngine2/zend_object_handlers.c:1.78 ZendEngine2/zend_object_handlers.c:1.79
--- ZendEngine2/zend_object_handlers.c:1.78 Thu Nov 27 14:08:28 2003
+++ ZendEngine2/zend_object_handlers.c Tue Dec 2 17:08:51 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_object_handlers.c,v 1.78 2003/11/27 19:08:28 helly Exp $ */
+/* $Id: zend_object_handlers.c,v 1.79 2003/12/02 22:08:51 helly Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -884,35 +884,6 @@
int zend_std_cast_object(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
{
- zval fname, *retval;
- int is_ref, refcount;
-
- switch (type) {
- case IS_STRING:
- ZVAL_STRING(&fname, "__tostring", 0);
- if (call_user_function_ex(NULL, &readobj, &fname, &retval, 0, NULL, 0, NULL
TSRMLS_CC) == SUCCESS) {
- if (retval) {
- if (Z_TYPE_P(retval) != IS_STRING) {
- zend_error(E_ERROR, "Method %s::__toString() must return a string value",
Z_OBJCE_P(readobj)->name);
- }
- } else {
- MAKE_STD_ZVAL(retval);
- ZVAL_STRINGL(retval, empty_string, 0, 0);
- }
- zval_dtor(writeobj);
- is_ref = writeobj->is_ref;
- refcount = writeobj->refcount;
- *writeobj = *retval;
- zval_copy_ctor(writeobj);
- writeobj->is_ref = is_ref;
- writeobj->refcount = refcount;
- zval_ptr_dtor(&retval);
- return SUCCESS;
- }
- break;
- default:
- break;
- }
return FAILURE;
}