Skip to content

Commit dc495bb

Browse files
committed
Merge branch 'PHP-5.5' of ssh://git.php.net/php-src into PHP-5.5
2 parents 1ff4352 + eb40f73 commit dc495bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1147
-123
lines changed

NEWS

+13-1
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,24 @@ PHP NEWS
1919

2020
- cURL:
2121
. Added new functions curl_escape, curl_multi_setopt, curl_multi_strerror
22-
curl_pause, curl_reset, curl_share_close, curl_share_init,
22+
curl_pause, curl_reset, curl_share_close, curl_share_init,
2323
curl_share_setopt curl_strerror and curl_unescape. (Pierrick)
2424
. Addes new curl options CURLOPT_TELNETOPTIONS, CURLOPT_GSSAPI_DELEGATION,
2525
CURLOPT_ACCEPTTIMEOUT_MS, CURLOPT_SSL_OPTIONS, CURLOPT_TCP_KEEPALIVE,
2626
CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL. (Pierrick)
2727

28+
- DateTime
29+
. Added DateTimeImmutable - a variant of DateTime that only returns the
30+
modified state instead of changing itself. (Derick)
31+
32+
- pgsql:
33+
. Bug #46408: Locale number format settings can cause pg_query_params to
34+
break with numerics. (asmecher, Lars)
35+
36+
- dba:
37+
. Bug #62489: dba_insert not working as expected.
38+
(marc-bennewitz at arcor dot de, Lars)
39+
2840
18 Dec 2012, PHP 5.5.0 Alpha 2
2941

3042
- General improvements:

Zend/zend_operators.c

+18
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,24 @@ ZEND_API void convert_to_boolean(zval *op) /* {{{ */
572572
}
573573
/* }}} */
574574

575+
ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC) /* {{{ */
576+
{
577+
double dval;
578+
switch (Z_TYPE_P(op)) {
579+
case IS_DOUBLE: {
580+
TSRMLS_FETCH();
581+
dval = Z_DVAL_P(op);
582+
Z_STRLEN_P(op) = zend_spprintf(&Z_STRVAL_P(op), 0, "%.*H", (int) EG(precision), dval);
583+
/* %H already handles removing trailing zeros from the fractional part, yay */
584+
break;
585+
}
586+
default:
587+
_convert_to_string(op ZEND_FILE_LINE_CC);
588+
}
589+
Z_TYPE_P(op) = IS_STRING;
590+
}
591+
/* }}} */
592+
575593
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
576594
{
577595
long lval;

Zend/zend_operators.h

+2
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ ZEND_API int increment_function(zval *op1);
301301
ZEND_API int decrement_function(zval *op2);
302302

303303
ZEND_API void convert_scalar_to_number(zval *op TSRMLS_DC);
304+
ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC);
304305
ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC);
305306
ZEND_API void convert_to_long(zval *op);
306307
ZEND_API void convert_to_double(zval *op);
@@ -314,6 +315,7 @@ ZEND_API void multi_convert_to_double_ex(int argc, ...);
314315
ZEND_API void multi_convert_to_string_ex(int argc, ...);
315316
ZEND_API int add_char_to_string(zval *result, const zval *op1, const zval *op2);
316317
ZEND_API int add_string_to_string(zval *result, const zval *op1, const zval *op2);
318+
#define convert_to_cstring(op) if ((op)->type != IS_STRING) { _convert_to_cstring((op) ZEND_FILE_LINE_CC); }
317319
#define convert_to_string(op) if ((op)->type != IS_STRING) { _convert_to_string((op) ZEND_FILE_LINE_CC); }
318320

319321
ZEND_API double zend_string_to_double(const char *number, zend_uint length);

0 commit comments

Comments
 (0)