if (PHP_INT_SIZE == 8) {
try {
// To go above year 9999: 60 * 60 * 24 * 365 * 9999
- setrawcookie('name', 'value', ['expires' => 315328464000]);
+ setcookie('name', 'value', ['expires' => 315328464000]);
} catch (\ValueError $e) {
var_dump($e->getMessage() == 'setcookie(): "expires" option cannot have a year greater than 9999');
}
setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array
-bool(false)
+bool(true)
array(1) {
[0]=>
string(%s) "X-Powered-By: PHP/%s"
} catch (\ValueError $e) {
echo $e->getMessage() . "\n";
}
-// To go above year 9999: 60 * 60 * 24 * 365 * 9999
-try {
- setrawcookie('name', 'value', 315328464000);
-} catch (\ValueError $e) {
- echo $e->getMessage() . "\n";
-}
try {
setrawcookie('name', 'value', 100, 'invalid;');
} catch (\ValueError $e) {
setrawcookie(): Argument #1 ($name) cannot be empty
setrawcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
setrawcookie(): Argument #2 ($value) cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
-setrawcookie(): "expires" option cannot have a year greater than 9999
setrawcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
setrawcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014"
bool(true)