Fixed bug #76755 (setcookie does not accept "double" type for expire time)

This commit is contained in:
Xinchen Hui 2018-08-17 13:45:43 +08:00
parent 2aa3733daa
commit d61ff37f45
3 changed files with 13 additions and 1 deletions

4
NEWS
View file

@ -12,6 +12,10 @@ PHP NEWS
. Fixed bug #76747 (Opcache treats path containing "test.pharma.tld" as a phar
file). (Laruence)
- Standard:
. Fixed bug #76755 (setcookie does not accept "double" type for expire time).
(Laruence)
16 Aug 2018, PHP 7.3.0beta2
- Core:

View file

@ -286,7 +286,7 @@ PHP_FUNCTION(setcookie)
goto cleanup;
}
} else {
expires = Z_LVAL_P(expires_or_options);
expires = zval_get_long(expires_or_options);
}
}

View file

@ -0,0 +1,8 @@
--TEST--
Bug #76755 (setcookie does not accept "double" type for expire time)
--FILE--
<?php
var_dump(setcookie('name', 'value', (real)(time() + 1296000)));
?>
--EXPECT--
bool(true)