| Marcus Boerger 2005-10-06, 6:55 pm |
| helly Thu Oct 6 15:11:01 2005 EDT
Modified files:
/ZendEngine2 zend_object_handlers.c
Log:
- BC: php objects convert to int/double 1 with notice
http://cvs.php.net/diff.php/ZendEng...9&r2=1.150&ty=u
Index: ZendEngine2/zend_object_handlers.c
diff -u ZendEngine2/zend_object_handlers.c:1.149 ZendEngine2/zend_object_handlers.c:1.150
--- ZendEngine2/zend_object_handlers.c:1.149 Thu Oct 6 14:46:01 2005
+++ ZendEngine2/zend_object_handlers.c Thu Oct 6 15:11:01 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_object_handlers.c,v 1.149 2005/10/06 18:46:01 helly Exp $ */
+/* $Id: zend_object_handlers.c,v 1.150 2005/10/06 19:11:01 helly Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -1042,6 +1042,18 @@
INIT_PZVAL(writeobj);
ZVAL_BOOL(writeobj, 1);
return SUCCESS;
+ case IS_LONG:
+ ce = Z_OBJCE_P(readobj);
+ zend_error(E_NOTICE, "Object of class %v could not be converted to int", ce->name);
+ INIT_PZVAL(writeobj);
+ ZVAL_LONG(writeobj, 1);
+ return SUCCESS;
+ case IS_DOUBLE:
+ ce = Z_OBJCE_P(readobj);
+ zend_error(E_NOTICE, "Object of class %v could not be converted to double", ce->name);
+ INIT_PZVAL(writeobj);
+ ZVAL_DOUBLE(writeobj, 1);
+ return SUCCESS;
default:
break;
}
|