Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement DateTimeImmutable::createFromMutable
Summary:Closes #6805 Closes #6846 Reviewed By: JoelMarcey Differential Revision: D2957341 Pulled By: JoelMarcey fb-gh-sync-id: caf85837f4d4320d5b2df0839d6a7b34196a850c shipit-source-id: caf85837f4d4320d5b2df0839d6a7b34196a850c
- Loading branch information
1 parent
dbc4523
commit 526ebfa
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
hphp/test/slow/ext_datetime/DateTimeImmutable_createFromMutable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
$current = "2014-03-02 16:24:08"; | ||
|
||
$i = DateTimeImmutable::createFromMutable( date_create( $current ) ); | ||
var_dump( $i ); | ||
|
||
$i = DateTimeImmutable::createFromMutable( date_create_immutable( $current ) ); | ||
var_dump( $i ); | ||
?> |
13 changes: 13 additions & 0 deletions
13
hphp/test/slow/ext_datetime/DateTimeImmutable_createFromMutable.php.expectf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
object(DateTimeImmutable)#%d (1) { | ||
["data":"DateTimeImmutable":private]=> | ||
object(DateTime)#%d (3) { | ||
["date"]=> | ||
string(26) "2014-03-02 16:24:08.000000" | ||
["timezone_type"]=> | ||
int(3) | ||
["timezone"]=> | ||
string(%s) "%s" | ||
} | ||
} | ||
|
||
Catchable fatal error: Argument 1 passed to DateTimeImmutable::createFromMutable() must be an instance of DateTime, DateTimeImmutable given in %s/DateTimeImmutable_createFromMutable.php on line 7 |