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;
}
/* }}} */
?>
--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