Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed bug where not the interface DateTimeInterface but only the impl…
…ementation DateTime was accepted
  • Loading branch information
wildewouter committed Jan 14, 2016
commit 0c55acbd1c82dbdee4830e76d2cb16eb8123173f
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct($name, $value = null, $expire = 0, $path = '/', $dom
}

// convert expiration time to a Unix timestamp
if ($expire instanceof \DateTime) {
if ($expire instanceof \DateTimeInterface) {
$expire = $expire->format('U');
} elseif (!is_numeric($expire)) {
$expire = strtotime($expire);
Expand Down