Skip to content

Commit

Permalink
Merge branch 'PHP-5.5'
Browse files Browse the repository at this point in the history
Conflicts:
	NEWS
  • Loading branch information
faizshukri committed Jan 15, 2013
2 parents 7a31692 + dc495bb commit c4fe37b
Show file tree
Hide file tree
Showing 54 changed files with 1,305 additions and 131 deletions.
1 change: 0 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<<<<<<< HEAD
?? ??? 201?, PHP 5.6.0

<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
18 changes: 18 additions & 0 deletions Zend/zend_operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,24 @@ ZEND_API void convert_to_boolean(zval *op) /* {{{ */
}
/* }}} */

ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC) /* {{{ */
{
double dval;
switch (Z_TYPE_P(op)) {
case IS_DOUBLE: {
TSRMLS_FETCH();
dval = Z_DVAL_P(op);
Z_STRLEN_P(op) = zend_spprintf(&Z_STRVAL_P(op), 0, "%.*H", (int) EG(precision), dval);
/* %H already handles removing trailing zeros from the fractional part, yay */
break;
}
default:
_convert_to_string(op ZEND_FILE_LINE_CC);
}
Z_TYPE_P(op) = IS_STRING;
}
/* }}} */

ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
{
long lval;
Expand Down
2 changes: 2 additions & 0 deletions Zend/zend_operators.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ ZEND_API int increment_function(zval *op1);
ZEND_API int decrement_function(zval *op2);

ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC);
ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC);
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC);
ZEND_API void convert_to_long(zval *op);
ZEND_API void convert_to_double(zval *op);
Expand All @@ -314,6 +315,7 @@ ZEND_API void multi_convert_to_double_ex(int argc, ...);
ZEND_API void multi_convert_to_string_ex(int argc, ...);
ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2);
ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2);
#define convert_to_cstring(op) if ((op)->type != IS_STRING) { _convert_to_cstring((op) ZEND_FILE_LINE_CC); }
#define convert_to_string(op) if ((op)->type != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }

ZEND_API double zend_string_to_double(const char *number, zend_uint length);
Expand Down
Loading

0 comments on commit c4fe37b

Please sign in to comment.