]> granicus.if.org Git - php/commitdiff
Fixing 44092
authorZoe Slattery <zoe@php.net>
Tue, 12 Feb 2008 07:27:49 +0000 (07:27 +0000)
committerZoe Slattery <zoe@php.net>
Tue, 12 Feb 2008 07:27:49 +0000 (07:27 +0000)
ext/standard/math.c
ext/standard/tests/math/exp_error.phpt

index 8bae01002429effbab40a0badb912c7198edea9a..ddd3541f977dc8f858f8a7d20e3b880add5ffffa 100644 (file)
@@ -471,14 +471,14 @@ PHP_FUNCTION(pow)
    Returns e raised to the power of the number */
 PHP_FUNCTION(exp)
 {
-       zval **num;
+        double num;
+
+        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "d", &num) == FAILURE) {
+                return;
+        }
+
+        RETURN_DOUBLE(exp(num));
 
-       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &num) == FAILURE) {
-               WRONG_PARAM_COUNT;
-       }
-       convert_to_double_ex(num);
-       Z_DVAL_P(return_value) = exp(Z_DVAL_PP(num));
-       Z_TYPE_P(return_value) = IS_DOUBLE;
 }
 /* }}} */
 
index f65743475cdb172427e56db6ecc21fd4feed6110..21949f4a74fe0130002275439e14f7ad09b71372 100644 (file)
@@ -9,6 +9,6 @@ exp(23,true);
 ?>
 --EXPECTF--
 
-Warning: Wrong parameter count for exp() in %s on line 2
+Warning: exp() expects exactly 1 parameter, 0 given in %s on line %d
 
-Warning: Wrong parameter count for exp() in %s on line 3
+Warning: exp() expects exactly 1 parameter, 2 given in %s on line %d