-
Notifications
You must be signed in to change notification settings - Fork 8k
Declare DateInterval properties #12566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -662,6 +662,18 @@ public static function __set_state(array $array): DateTimeZone {} | |
|
|
||
| class DateInterval | ||
| { | ||
| public ?int $y; | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The manual states that |
||
| public ?int $m; | ||
| public ?int $d; | ||
| public ?int $h; | ||
| public ?int $i; | ||
| public ?int $s; | ||
| public ?float $f; | ||
| public ?int $invert; | ||
| public int|false $days; | ||
| public bool $from_string; | ||
| public ?string $date_string; | ||
|
|
||
| public function __construct(string $duration) {} | ||
|
|
||
| /** | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,24 @@ try { | |
| --EXPECTF-- | ||
| Original object: | ||
| object(DateInterval)#1 (%d) { | ||
| ["y"]=> | ||
| NULL | ||
| ["m"]=> | ||
| NULL | ||
| ["d"]=> | ||
| NULL | ||
| ["h"]=> | ||
| NULL | ||
| ["i"]=> | ||
| NULL | ||
| ["s"]=> | ||
| NULL | ||
| ["f"]=> | ||
| NULL | ||
| ["invert"]=> | ||
| NULL | ||
| ["days"]=> | ||
| bool(false) | ||
| ["from_string"]=> | ||
| bool(true) | ||
| ["date_string"]=> | ||
|
|
@@ -49,11 +67,29 @@ object(DateInterval)#1 (%d) { | |
|
|
||
|
|
||
| Serialised object: | ||
| string(%d) "O:12:"DateInterval":2:{s:11:"from_string";b:1;s:11:"date_string";s:%d:"next weekday";}" | ||
| string(187) "O:12:"DateInterval":11:{s:1:"y";N;s:1:"m";N;s:1:"d";N;s:1:"h";N;s:1:"i";N;s:1:"s";N;s:1:"f";N;s:6:"invert";N;s:4:"days";b:0;s:11:"from_string";b:1;s:11:"date_string";s:12:"next weekday";}" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These empty properties may significantly increase the size of serialized data. |
||
|
|
||
|
|
||
| Unserialised object: | ||
| object(DateInterval)#2 (2) { | ||
| object(DateInterval)#2 (11) { | ||
| ["y"]=> | ||
| NULL | ||
| ["m"]=> | ||
| NULL | ||
| ["d"]=> | ||
| NULL | ||
| ["h"]=> | ||
| NULL | ||
| ["i"]=> | ||
| NULL | ||
| ["s"]=> | ||
| NULL | ||
| ["f"]=> | ||
| NULL | ||
| ["invert"]=> | ||
| NULL | ||
| ["days"]=> | ||
| bool(false) | ||
| ["from_string"]=> | ||
| bool(true) | ||
| ["date_string"]=> | ||
|
|
@@ -62,7 +98,25 @@ object(DateInterval)#2 (2) { | |
|
|
||
|
|
||
| Calling __serialize manually: | ||
| array(2) { | ||
| array(11) { | ||
| ["y"]=> | ||
| NULL | ||
| ["m"]=> | ||
| NULL | ||
| ["d"]=> | ||
| NULL | ||
| ["h"]=> | ||
| NULL | ||
| ["i"]=> | ||
| NULL | ||
| ["s"]=> | ||
| NULL | ||
| ["f"]=> | ||
| NULL | ||
| ["invert"]=> | ||
| NULL | ||
| ["days"]=> | ||
| bool(false) | ||
| ["from_string"]=> | ||
| bool(true) | ||
| ["date_string"]=> | ||
|
|
@@ -71,7 +125,25 @@ array(2) { | |
|
|
||
|
|
||
| Calling __unserialize manually: | ||
| object(DateInterval)#3 (2) { | ||
| object(DateInterval)#3 (11) { | ||
| ["y"]=> | ||
| NULL | ||
| ["m"]=> | ||
| NULL | ||
| ["d"]=> | ||
| NULL | ||
| ["h"]=> | ||
| NULL | ||
| ["i"]=> | ||
| NULL | ||
| ["s"]=> | ||
| NULL | ||
| ["f"]=> | ||
| NULL | ||
| ["invert"]=> | ||
| NULL | ||
| ["days"]=> | ||
| bool(false) | ||
| ["from_string"]=> | ||
| bool(true) | ||
| ["date_string"]=> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This backslash looks astray.