mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Convert UNKNOWN default values to null in ext/calendar
This commit is contained in:
parent
8a41c9e025
commit
089d8cb03c
5 changed files with 19 additions and 20 deletions
|
@ -25,14 +25,15 @@
|
|||
Convert UNIX timestamp to Julian Day */
|
||||
PHP_FUNCTION(unixtojd)
|
||||
{
|
||||
time_t ts = 0;
|
||||
time_t ts;
|
||||
zend_bool ts_is_null = 1;
|
||||
struct tm *ta, tmbuf;
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &ts) == FAILURE) {
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l!", &ts, &ts_is_null) == FAILURE) {
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
if (!ts) {
|
||||
if (ts_is_null) {
|
||||
ts = time(NULL);
|
||||
} else if (ts < 0) {
|
||||
zend_argument_value_error(1, "must be greater than or equal to 0");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue