From a628bc8856c885d183404d527a73fb1660c92048 Mon Sep 17 00:00:00 2001 From: Zoe Slattery Date: Tue, 12 Feb 2008 07:27:49 +0000 Subject: [PATCH] Fixing 44092 --- ext/standard/math.c | 14 +++++++------- ext/standard/tests/math/exp_error.phpt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/standard/math.c b/ext/standard/math.c index 8bae010024..ddd3541f97 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -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; } /* }}} */ diff --git a/ext/standard/tests/math/exp_error.phpt b/ext/standard/tests/math/exp_error.phpt index f65743475c..21949f4a74 100644 --- a/ext/standard/tests/math/exp_error.phpt +++ b/ext/standard/tests/math/exp_error.phpt @@ -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 -- 2.40.0