From 7d2a02feb6396b23ece4b82235d6796e2fe1d78d Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Thu, 6 Oct 2005 19:11:01 +0000 Subject: [PATCH] - BC: php objects convert to int/double 1 with notice --- Zend/zend_object_handlers.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 976c24b51b..3940d3f433 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1042,6 +1042,18 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty 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; } -- 2.50.1