]> granicus.if.org Git - php/commitdiff
- Fixed bug #44533 (floatval() issues E_NOTICE "non well formed numeric value")
authorFelipe Pena <felipe@php.net>
Sat, 29 Mar 2008 22:02:20 +0000 (22:02 +0000)
committerFelipe Pena <felipe@php.net>
Sat, 29 Mar 2008 22:02:20 +0000 (22:02 +0000)
(Keep the old behavior, as other related functions)

ext/standard/type.c

index b565848d742caddd49126e7652904674f858cb98..19ca9d03be51e669e58c520aefc6449de2188776 100644 (file)
@@ -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);
 }
 /* }}} */