diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2008-03-09 18:09:53 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2008-03-09 18:09:53 +0000 |
commit | 33e23bd3554e360d12bdd5cabfc38429b805f976 (patch) | |
tree | 6db0acba21c35ca493a41a21fb2f87a84ab5f19f | |
parent | 5d9e462ecfa5b9a0a65b0851b8d4c2e2d03f0369 (diff) | |
download | php-git-33e23bd3554e360d12bdd5cabfc38429b805f976.tar.gz |
Initialize ts only after successful argument parsing
-rw-r--r-- | ext/date/php_date.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 9a9b5d61f4..fdd7bc2930 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -899,12 +899,12 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime) long ts; char *string; - if (ZEND_NUM_ARGS() == 1) { - ts = time(NULL); - } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &format, &format_len, &ts) == FAILURE) { RETURN_FALSE; } + if (ZEND_NUM_ARGS() == 1) { + ts = time(NULL); + } string = php_format_date(format, format_len, ts, localtime TSRMLS_CC); |