Index: Zend/zend_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_API.c,v retrieving revision 1.296.2.27.2.9 diff -u -p -d -r1.296.2.27.2.9 zend_API.c --- Zend/zend_API.c 23 May 2006 22:22:11 -0000 1.296.2.27.2.9 +++ Zend/zend_API.c 25 May 2006 09:53:09 -0000 @@ -197,34 +197,7 @@ ZEND_API void zend_wrong_param_count(TSR ZEND_API char *zend_zval_type_name(zval *arg) { - switch (Z_TYPE_P(arg)) { - case IS_NULL: - return "null"; - - case IS_LONG: - return "integer"; - - case IS_DOUBLE: - return "double"; - - case IS_STRING: - return "string"; - - case IS_ARRAY: - return "array"; - - case IS_OBJECT: - return "object"; - - case IS_BOOL: - return "boolean"; - - case IS_RESOURCE: - return "resource"; - - default: - return "unknown"; - } + return zend_get_type_by_const(Z_TYPE_P(arg)); } ZEND_API zend_class_entry *zend_get_class_entry(zval *zobject TSRMLS_DC) Index: Zend/zend_operators.c =================================================================== RCS file: /repository/ZendEngine2/zend_operators.c,v retrieving revision 1.208.2.4.2.1 diff -u -p -d -r1.208.2.4.2.1 zend_operators.c --- Zend/zend_operators.c 9 May 2006 23:53:23 -0000 1.208.2.4.2.1 +++ Zend/zend_operators.c 25 May 2006 09:53:10 -0000 @@ -271,7 +271,8 @@ ZEND_API void convert_scalar_to_number(z zval dst; \ if (Z_OBJ_HT_P(op)->cast_object(op, &dst, ctype TSRMLS_CC) == FAILURE) { \ zend_error(E_RECOVERABLE_ERROR, \ - "Object of class %s could not be converted to " # ctype, Z_OBJCE_P(op)->name); \ + "Object of class %s could not be converted to %s", Z_OBJCE_P(op)->name, \ + zend_get_type_by_const(ctype)); \ } else { \ zval_dtor(op); \ Z_TYPE_P(op) = ctype; \ @@ -290,6 +291,29 @@ ZEND_API void convert_scalar_to_number(z } \ } +ZEND_API char *zend_get_type_by_const(int type) +{ + switch(type) { + case IS_BOOL: + return "boolean"; + case IS_LONG: + return "integer"; + case IS_DOUBLE: + return "double"; + case IS_STRING: + return "string"; + case IS_OBJECT: + return "object"; + case IS_RESOURCE: + return "resource"; + case IS_NULL: + return "null"; + case IS_ARRAY: + return "array"; + default: + return "unknown"; + } +} ZEND_API void convert_to_long(zval *op) { Index: Zend/zend_operators.h =================================================================== RCS file: /repository/ZendEngine2/zend_operators.h,v retrieving revision 1.94.2.4.2.1 diff -u -p -d -r1.94.2.4.2.1 zend_operators.h --- Zend/zend_operators.h 9 May 2006 23:53:23 -0000 1.94.2.4.2.1 +++ Zend/zend_operators.h 25 May 2006 09:53:10 -0000 @@ -165,6 +165,8 @@ BEGIN_EXTERN_C() ZEND_API int increment_function(zval *op1); ZEND_API int decrement_function(zval *op2); +ZEND_API char *zend_get_type_by_const(int type); + ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC); ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC); ZEND_API void convert_to_long(zval *op);