From: Marcus Boerger Date: Thu, 6 Oct 2005 19:11:01 +0000 (+0000) Subject: - BC: php objects convert to int/double 1 with notice X-Git-Tag: RELEASE_0_9_1~220 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d2a02feb6396b23ece4b82235d6796e2fe1d78d;p=php - BC: php objects convert to int/double 1 with notice --- 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; }