From: Felipe Pena Date: Sat, 29 Mar 2008 22:02:20 +0000 (+0000) Subject: - Fixed bug #44533 (floatval() issues E_NOTICE "non well formed numeric value") X-Git-Tag: RELEASE_2_0_0b1~533 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a5536a03341e51d4ad39c9d4b3182cf7e889629;p=php - Fixed bug #44533 (floatval() issues E_NOTICE "non well formed numeric value") (Keep the old behavior, as other related functions) --- diff --git a/ext/standard/type.c b/ext/standard/type.c index b565848d74..19ca9d03be 100644 --- a/ext/standard/type.c +++ b/ext/standard/type.c @@ -179,13 +179,14 @@ PHP_FUNCTION(intval) Get the float value of a variable */ PHP_FUNCTION(floatval) { - double retval; + zval **num; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &retval) == FAILURE) { - return; + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) { + WRONG_PARAM_COUNT; } - RETURN_DOUBLE(retval); + RETVAL_ZVAL(*num, 1, 0); + convert_to_double(return_value); } /* }}} */