Skip to content

Commit 213706f

Browse files
committed
Reduce memory overhead of DatePeriod via virtual properties
Related to php#11644 and php#13988
1 parent 8487ddb commit 213706f

File tree

3 files changed

+39
-15
lines changed

3 files changed

+39
-15
lines changed

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,9 @@ PHP 8.4 UPGRADE NOTES
10741074
of functions as well as serialization functions such as `json_encode()`,
10751075
`serialize()`.
10761076

1077+
- Date:
1078+
. Reduced memory usage of DatePeriod.
1079+
10771080
- DOM:
10781081
. The performance of DOMNode::C14N() is greatly improved for the case without
10791082
an xpath query. This can give a time improvement of easily two order of

ext/date/php_date.stub.php

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -673,19 +673,40 @@ class DatePeriod implements IteratorAggregate
673673
/** @cvalue PHP_DATE_PERIOD_INCLUDE_END_DATE */
674674
public const int INCLUDE_END_DATE = UNKNOWN;
675675

676-
/** @readonly */
676+
/**
677+
* @readonly
678+
* @virtual
679+
*/
677680
public ?DateTimeInterface $start;
678-
/** @readonly */
681+
/**
682+
* @readonly
683+
* @virtual
684+
*/
679685
public ?DateTimeInterface $current;
680-
/** @readonly */
686+
/**
687+
* @readonly
688+
* @virtual
689+
*/
681690
public ?DateTimeInterface $end;
682-
/** @readonly */
691+
/**
692+
* @readonly
693+
* @virtual
694+
*/
683695
public ?DateInterval $interval;
684-
/** @readonly */
696+
/**
697+
* @readonly
698+
* @virtual
699+
*/
685700
public int $recurrences;
686-
/** @readonly */
701+
/**
702+
* @readonly
703+
* @virtual
704+
*/
687705
public bool $include_start_date;
688-
/** @readonly */
706+
/**
707+
* @readonly
708+
* @virtual
709+
*/
689710
public bool $include_end_date;
690711

691712
public static function createFromISO8601String(string $specification, int $options = 0): static {}

ext/date/php_date_arginfo.h

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)