Menu

## CarbonPeriodImmutable extends CarbonPeriod
in package

CarbonPeriodImmutable.php : 16

Substitution of DatePeriod with some modifications and many more features.

### Table of Contents

#### Constants

END_DATE_FILTER = [self::class, 'filterEndDate']
  Built-in filter for limit to an end.
END_ITERATION = [self::class, 'endIteration']
  Special value which can be returned by filters to end iteration. Also a filter.
END_MAX_ATTEMPTS = 10000
  Number of maximum attempts before giving up on finding end date.
EXCLUDE_END_DATE = 8
  Exclude end date from iteration.
IMMUTABLE = 4
  Yield CarbonImmutable instances.
NEXT_MAX_ATTEMPTS = 1000
  Number of maximum attempts before giving up on finding next valid date.
RECURRENCES_FILTER = [self::class, 'filterRecurrences']
  Built-in filter for limit by recurrences.
DEFAULT_DATE_CLASS = \Carbon\CarbonImmutable::class
  Default date class of iteration items.

#### Properties

$carbonCurrent : CarbonInterface|null
  Current date. May temporarily hold unaccepted value when looking for a next valid date.
$carbonRecurrences : int|float|null
  Limit for number of recurrences. Applied via a filter.
$constructed : bool
  True once __construct is finished.
$dateClass : string
  Date class of iteration items.
$dateInterval : CarbonInterval|null
  Underlying date interval instance. Always present, one day by default.
$endDate : CarbonInterface|null
  Period end date. For inverted interval should be before the start date. Applied via a filter.
$filters : array<string|int, mixed>
  The filters stack.
$isDefaultInterval : bool
  Whether current date interval was set by default.
$key : int
  Index of current date. Always sequential, even if some dates are skipped by filters.
$localFormatFunction : string|callable|null
  Function to call instead of format.
$localGenericMacros : array<string|int, mixed>|null
  Instance-specific generic macros.
$localHumanDiffOptions : int|null
  Options for diffForHumans and forHumans methods.
$localMacros : array<string|int, mixed>|null
  Instance-specific macros.
$localMonthsOverflow : bool|null
  Indicates if months should be calculated with overflow.
$localSerializer : string|callable|null
  Format to use on JSON serialization.
$localStrictModeEnabled : bool|null
  Indicates if the strict mode is in use.
$localToStringFormat : string|callable|null
  Format to use on string cast.
$localYearsOverflow : bool|null
  Indicates if years should be calculated with overflow.
$macroContextStack : array<string|int, mixed>
  Stack of macro instance contexts.
$macros : array<string|int, mixed>
  The registered macros.
$options : int|null
  Iteration options.
$startDate : CarbonInterface|null
  Period start date. Applied on rewind. Always present, now by default.
$timezone : DateTimeZone|null
  Timezone of current date. Taken from the start date.
$timezoneSetting : DateTimeZone|string|int|null
  Timezone handler for settings() method.
$validationResult : array<string|int, mixed>|string|bool|null
  The cached validation result for current date.
$clock : WrapperClock|null
  The clock that generated the current instance (or FactoryImmutable::getDefaultInstance() if none)

#### Methods

__call() : mixed
  Add aliases for setters.
__callStatic() : mixed
  Provide static proxy for instance aliases.
__construct() : mixed
  CarbonPeriod constructor.
__debugInfo() : array<string|int, mixed>
  Show truthy properties on var_dump().
__get() : bool|CarbonInterface|CarbonInterval|int|null
  Get a property allowing both `DatePeriod` snakeCase and camelCase names.
__isset() : bool
  Check if an attribute exists on the object
__toString() : string
  Convert the date period into a string.
addFilter() : static
  Add a filter to the stack.
between() : static
calculateEnd() : CarbonInterface
  Returns the end is set, else calculated from start and recurrences.
cast() : DatePeriod|object
  Cast the current instance into the given class.
ceil() : static
  Ceil the current instance second with given precision if specified (else period interval is used).
ceilCenturies() : $this
ceilCentury() : $this
ceilDay() : $this
ceilDays() : $this
ceilDecade() : $this
ceilDecades() : $this
ceilHour() : $this
ceilHours() : $this
ceilMicrosecond() : $this
ceilMicroseconds() : $this
ceilMillennia() : $this
ceilMillennium() : $this
ceilMillisecond() : $this
ceilMilliseconds() : $this
ceilMinute() : $this
ceilMinutes() : $this
ceilMonth() : $this
ceilMonths() : $this
ceilQuarter() : $this
ceilQuarters() : $this
ceilSecond() : $this
ceilSeconds() : $this
ceilUnit() : static
  Ceil the current instance at the given unit with given precision if specified.
ceilWeek() : $this
ceilWeeks() : $this
ceilYear() : $this
ceilYears() : $this
clone() : static
contains() : bool
  Return true if the given date is between start and end.
copy() : static
  Get a copy of the instance.
count() : int
  Count dates in the date period.
create() : static
  Create a new instance.
createFromArray() : static
  Create a new instance from an array of parameters.
createFromIso() : static
  Create CarbonPeriod from ISO 8601 string.
current() : CarbonInterface|null
  Return the current date.
dates() : static
day() : static
days() : static
dayz() : static
each() : static
end() : static|CarbonInterface
endsAfter() : bool
  Determines if the end date is after another given date.
endsAfterOrAt() : bool
  Determines if the end date is after or the same as a given date.
endsAt() : bool
  Determines if the end date is the same as a given date.
endsBefore() : bool
  Determines if the end date is before another given date.
endsBeforeOrAt() : bool
  Determines if the end date is before or the same as a given date.
eq() : bool
  Determines if the instance is equal to another.
equalTo() : bool
  Determines if the instance is equal to another.
every() : static
excludeEndDate() : static
  Toggle EXCLUDE_END_DATE option.
excludeStartDate() : static
  Toggle EXCLUDE_START_DATE option.
filter() : static
filters() : static|array<string|int, mixed>
first() : CarbonInterface|null
  Return the first date in the date period.
floor() : static
  Round the current instance second with given precision if specified (else period interval is used).
floorCenturies() : $this
floorCentury() : $this
floorDay() : $this
floorDays() : $this
floorDecade() : $this
floorDecades() : $this
floorHour() : $this
floorHours() : $this
floorMicrosecond() : $this
floorMicroseconds() : $this
floorMillennia() : $this
floorMillennium() : $this
floorMillisecond() : $this
floorMilliseconds() : $this
floorMinute() : $this
floorMinutes() : $this
floorMonth() : $this
floorMonths() : $this
floorQuarter() : $this
floorQuarters() : $this
floorSecond() : $this
floorSeconds() : $this
floorUnit() : static
  Truncate the current instance at the given unit with given precision if specified.
floorWeek() : $this
floorWeeks() : $this
floorYear() : $this
floorYears() : $this
follows() : bool
  Return true if the current period follows a given other period (with no overlap).
forEach() : void
  Execute a given function on each date of the period.
get() : bool|CarbonInterface|CarbonInterval|int|null
  Get a property allowing both `DatePeriod` snakeCase and camelCase names.
getClock() : WrapperClock|null
getDateClass() : string
  Returns iteration item date class.
getDateInterval() : CarbonInterval
  Get the underlying date interval.
getEndDate() : CarbonInterface|null
  Get end date of the period.
getFilters() : array<string|int, mixed>
  Get filters stack.
getIncludedEndDate() : CarbonInterface
  Return the end if it's included by option, else return the end - 1 period interval.
getIncludedStartDate() : CarbonInterface
  Return the start if it's included by option, else return the start + 1 period interval.
getIterator() : Generator
getOptions() : int
  Get the period options.
getRecurrences() : int|float|null
  Get number of recurrences.
getSettings() : array<string|int, mixed>
  Returns current local settings.
getStartDate() : CarbonInterface
  Get start date of the period.
hasFilter() : bool
  Return whether given instance or name is in the filter stack.
hasMacro() : bool
  Check if macro is registered.
hour() : static
hours() : static
instance() : static
  Create a new instance from a DatePeriod or CarbonPeriod object.
interval() : static|CarbonInterval
invert() : static
invertDateInterval() : static
  Invert the period date interval.
isConsecutiveWith() : bool
  Return true if the given period either follows or is followed by the current one.
isEnded() : bool
  Return true if end date is now or later.
isEndExcluded() : bool
  Returns true if the end date should be excluded.
isEndIncluded() : bool
  Returns true if the end date should be included.
isFollowedBy() : bool
  Return true if the given other period follows the current one (with no overlap).
isInProgress() : bool
  Return true if now is between start date (included) and end date (excluded).
isStarted() : bool
  Return true if start date is now or later.
isStartExcluded() : bool
  Returns true if the start date should be excluded.
isStartIncluded() : bool
  Returns true if the start date should be included.
isUnfilteredAndEndLess() : bool
  Return `true` if the period has no custom filter and is guaranteed to be endless.
jsonSerialize() : array<string|int, CarbonInterface>
  Specify data which should be serialized to JSON.
key() : int|null
  Return the current key.
last() : CarbonInterface|null
  Return the last date in the date period.
macro() : void
  Register a custom macro.
make() : static|null
  Make a CarbonPeriod instance from given variable if possible.
map() : Generator
  Execute a given function on each date of the period and yield the result of this function.
microsecond() : static
microseconds() : static
millisecond() : static
milliseconds() : static
minute() : static
minutes() : static
mixin() : void
  Mix another object into the class.
month() : static
months() : static
ne() : bool
  Determines if the instance is not equal to another.
next() : void
  Move forward to the next date.
notEqualTo() : bool
  Determines if the instance is not equal to another.
options() : static|int|null
overlaps() : bool
  Returns true if the current period overlaps the given one (if 1 parameter passed) or the period between 2 dates (if 2 parameters passed).
prepend() : static
prependFilter() : static
  Prepend a filter to the stack.
push() : static
recurrences() : static
removeFilter() : static
  Remove a filter by instance or name.
resetDateInterval() : static
  Reset the date interval to the default value.
resetFilters() : static
  Reset filters stack.
resetToStringFormat() : void
  Reset the format used to the default when type juggling a Carbon instance to a string
rewind() : void
  Rewind to the start date.
round() : static
  Round the current instance second with given precision if specified (else period interval is used).
roundCenturies() : $this
roundCentury() : $this
roundDay() : $this
roundDays() : $this
roundDecade() : $this
roundDecades() : $this
roundHour() : $this
roundHours() : $this
roundMicrosecond() : $this
roundMicroseconds() : $this
roundMillennia() : $this
roundMillennium() : $this
roundMillisecond() : $this
roundMilliseconds() : $this
roundMinute() : $this
roundMinutes() : $this
roundMonth() : $this
roundMonths() : $this
roundQuarter() : $this
roundQuarters() : $this
roundSecond() : $this
roundSeconds() : $this
roundUnit() : static
  Round the current instance at the given unit with given precision if specified and the given function.
roundWeek() : $this
roundWeeks() : $this
roundYear() : $this
roundYears() : $this
second() : static
seconds() : static
setDateClass() : static
  Set the iteration item class.
setDateInterval() : static
  Change the period date interval.
setDates() : static
  Set start and end date.
setEndDate() : static
  Change the period end date.
setFilters() : static
  Set filters stack.
setOptions() : static
  Change the period options.
setRecurrences() : static
  Add a recurrences filter (set maximum number of recurrences).
setStartDate() : static
  Change the period start date.
setTimezone() : static
  Set the instance's timezone from a string or object and apply it to start/end.
settings() : $this|static
  Set specific options.
setToStringFormat() : void
shiftTimezone() : static
  Set the instance's timezone from a string or object and add/subtract the offset difference to start/end.
since() : static
sinceNow() : static
skip() : bool
  Skip iterations and returns iteration state (false if ended, true if still valid).
spec() : string
  Format the date period as ISO 8601.
start() : static|CarbonInterface
startsAfter() : bool
  Determines if the start date is after another given date.
startsAfterOrAt() : bool
  Determines if the start date is after or the same as a given date.
startsAt() : bool
  Determines if the start date is the same as a given date.
startsBefore() : bool
  Determines if the start date is before another given date.
startsBeforeOrAt() : bool
  Determines if the start date is before or the same as a given date.
step() : static
stepBy() : static
times() : static
toArray() : array<string|int, CarbonInterface>
  Convert the date period into an array without changing current iteration state.
toDatePeriod() : DatePeriod
  Return native DatePeriod PHP object matching the current instance.
toggle() : static
toggleOptions() : static
  Toggle given options on or off.
toIso8601String() : string
  Format the date period as ISO 8601.
toString() : string
  Convert the date period into a string.
until() : static
untilNow() : static
valid() : bool
  Check if the current position is valid.
week() : static
weeks() : static
year() : static
years() : static
addExtraDebugInfos() : void
addMissingParts() : string
  Add missing parts of the target date from the source date.
bindMacroContext() : mixed
  Stack a Carbon context from inside calls of self::this() and execute a given action.
callMacro() : mixed
  Call given macro.
callRoundMethod() : static|null
checkFilters() : bool|static::END_ITERATION
  Check whether current value and key pass all the filters.
context() : static|null
  Return the current context from inside a macro callee or a null if static.
copyIfImmutable() : static
  Prepare the instance to be set (self if mutable to be mutated, copy if immutable to generate a new instance).
createFilterTuple() : array<string|int, mixed>
  Create a filter tuple from raw parameters.
endIteration() : static::END_ITERATION
  End iteration filter callback.
filterEndDate() : bool|static::END_ITERATION
  End date filter callback.
filterRecurrences() : bool|callable
  Recurrences filter callback (limits number of recurrences).
getGetter() : callable|null
  Get the getter for a property allowing both `DatePeriod` snakeCase and camelCase names.
handleChangedParameters() : void
  Handle change of the parameters.
incrementCurrentDateUntilValid() : void
  Keep incrementing the current date until a valid date is found or the iteration is ended.
intervalHasTime() : bool
  Return whether given interval contains non zero value of any time unit.
isCarbonPredicateMethod() : bool
  Return whether given callable is a string pointing to one of Carbon's is* methods and should be automatically converted to a filter callback.
isIso8601() : bool
  Return whether given variable is an ISO 8601 specification.
isLocalStrictModeEnabled() : bool
parseIso8601() : array<string|int, mixed>
  Parse given ISO 8601 string into an array of arguments.
prepareForReturn() : CarbonInterface
  Prepare given date to be returned to the external logic.
resolveCarbon() : CarbonInterface
  Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.
resolveCarbonPeriod() : self
  Resolve passed arguments or DatePeriod to a CarbonPeriod object.
roundWith() : static|null
this() : static
  Return the current context from inside a macro callee or a new one if static.
updateInternalState() : void
  Update properties after removing built-in filters.
validateCurrentDate() : bool|static::END_ITERATION
  Validate current date and stop iteration when necessary.
configureTimezone() : array<string|int, mixed>
getAnonymousClassCodeForTrait() : string
getEndFromRecurrences() : CarbonInterface|null
getFactory() : Factory
getMixableMethods() : Generator
initLocalFactory() : void
isInfiniteDate() : bool
iterateUntilEnd() : CarbonInterface|null
loadMixinClass() : void
loadMixinTrait() : void
makeDateTime() : DateTimeInterface|null
makeInterval() : CarbonInterval|null
makeTimezone() : CarbonTimeZone|null
orderCouple() : array<string|int, mixed>
rawDate() : DateTimeInterface|null
setDefaultParameters() : void
setFromAssociativeArray() : void
transmitFactory() : T
  Trigger the given action using the local factory of the object, so it will be transmitted to any object also using this trait and calling initLocalFactory() in its constructor.

### Constants

#### END_DATE_FILTER

CarbonPeriod.php : 207

Built-in filter for limit to an end.

`public callable END_DATE_FILTER = [self::class, 'filterEndDate']`

#### END_ITERATION

CarbonPeriod.php : 214

Special value which can be returned by filters to end iteration. Also a filter.

`public callable END_ITERATION = [self::class, 'endIteration']`

#### END_MAX_ATTEMPTS

CarbonPeriod.php : 242

Number of maximum attempts before giving up on finding end date.

`public int END_MAX_ATTEMPTS = 10000`

#### EXCLUDE_END_DATE

CarbonPeriod.php : 221

Exclude end date from iteration.

`public int EXCLUDE_END_DATE = 8`

#### IMMUTABLE

CarbonPeriod.php : 228

Yield CarbonImmutable instances.

`public int IMMUTABLE = 4`

#### NEXT_MAX_ATTEMPTS

CarbonPeriod.php : 235

Number of maximum attempts before giving up on finding next valid date.

`public int NEXT_MAX_ATTEMPTS = 1000`

#### RECURRENCES_FILTER

CarbonPeriod.php : 200

Built-in filter for limit by recurrences.

`public callable RECURRENCES_FILTER = [self::class, 'filterRecurrences']`

#### DEFAULT_DATE_CLASS

CarbonPeriodImmutable.php : 23

Default date class of iteration items.

`protected string DEFAULT_DATE_CLASS = \Carbon\CarbonImmutable::class`

### Properties

#### $carbonCurrent

CarbonPeriod.php : 311

Current date. May temporarily hold unaccepted value when looking for a next valid date.

`protected CarbonInterface|null $carbonCurrent = null`

Equal to null only before the first iteration.

#### $carbonRecurrences

CarbonPeriod.php : 294

Limit for number of recurrences. Applied via a filter.

`protected int|float|null $carbonRecurrences = null`

#### $constructed

CarbonPeriod.php : 269

True once __construct is finished.

`protected bool $constructed = false`

#### $dateClass

CarbonPeriodImmutable.php : 28

Date class of iteration items.

`protected string $dateClass = \Carbon\CarbonImmutable::class`

#### $dateInterval

CarbonPeriod.php : 264

Underlying date interval instance. Always present, one day by default.

`protected CarbonInterval|null $dateInterval = null`

#### $endDate

CarbonPeriod.php : 289

Period end date. For inverted interval should be before the start date. Applied via a filter.

`protected CarbonInterface|null $endDate = null`

#### $filters

CarbonPeriod.php : 279

The filters stack.

`protected array<string|int, mixed> $filters = []`

#### $isDefaultInterval

CarbonPeriod.php : 274

Whether current date interval was set by default.

`protected bool $isDefaultInterval = false`

#### $key

CarbonPeriod.php : 305

Index of current date. Always sequential, even if some dates are skipped by filters.

`protected int $key = 0`

Equal to null only before the first iteration.

#### $localFormatFunction

Options.php : 86

Function to call instead of format.

`protected string|callable|null $localFormatFunction = null`

#### $localGenericMacros

Options.php : 79

Instance-specific generic macros.

`protected array<string|int, mixed>|null $localGenericMacros = null`

#### $localHumanDiffOptions

Options.php : 55

Options for diffForHumans and forHumans methods.

`protected int|null $localHumanDiffOptions = null`

#### $localMacros

Options.php : 74

Instance-specific macros.

`protected array<string|int, mixed>|null $localMacros = null`

#### $localMonthsOverflow

Options.php : 38

Indicates if months should be calculated with overflow.

`protected bool|null $localMonthsOverflow = null`

Specific setting.

#### $localSerializer

Options.php : 69

Format to use on JSON serialization.

`protected string|callable|null $localSerializer = null`

#### $localStrictModeEnabled

Options.php : 50

Indicates if the strict mode is in use.

`protected bool|null $localStrictModeEnabled = null`

Specific setting.

#### $localToStringFormat

Options.php : 62

Format to use on string cast.

`protected string|callable|null $localToStringFormat = null`

#### $localYearsOverflow

Options.php : 44

Indicates if years should be calculated with overflow.

`protected bool|null $localYearsOverflow = null`

Specific setting.

#### $macroContextStack

Mixin.php : 36

Stack of macro instance contexts.

`protected static array<string|int, mixed> $macroContextStack = []`

#### $macros

CarbonPeriod.php : 254

The registered macros.

`protected static array<string|int, mixed> $macros = []`

#### $options

CarbonPeriod.php : 299

Iteration options.

`protected int|null $options = null`

#### $startDate

CarbonPeriod.php : 284

Period start date. Applied on rewind. Always present, now by default.

`protected CarbonInterface|null $startDate = null`

#### $timezone

CarbonPeriod.php : 316

Timezone of current date. Taken from the start date.

`protected DateTimeZone|null $timezone = null`

#### $timezoneSetting

CarbonPeriod.php : 326

Timezone handler for settings() method.

`protected DateTimeZone|string|int|null $timezoneSetting = null`

#### $validationResult

CarbonPeriod.php : 321

The cached validation result for current date.

`protected array<string|int, mixed>|string|bool|null $validationResult = null`

#### $clock

LocalFactory.php : 29

The clock that generated the current instance (or FactoryImmutable::getDefaultInstance() if none)

`private WrapperClock|null $clock = null`

### Methods

#### __call()

CarbonPeriod.php : 1637

Add aliases for setters.

`public __call(string $method, array<string|int, mixed> $parameters) : mixed`

CarbonPeriod::days(3)->hours(5)->invert() ->sinceNow()->until('2010-01-10') ->filter(...) ->count()

Note: We use magic method to let static and instance aliases with the same names.

##### Parameters

$method : string
$parameters : array<string|int, mixed>

#### __callStatic()

CarbonPeriod.php : 584

Provide static proxy for instance aliases.

`public static __callStatic(string $method, array<string|int, mixed> $parameters) : mixed`

##### Parameters

$method : string
$parameters : array<string|int, mixed>

#### __construct()

CarbonPeriod.php : 602

CarbonPeriod constructor.

`public __construct(mixed ...$arguments) : mixed`

##### Parameters

$arguments : mixed

##### Tags

SuppressWarnings

  (PHPMD.ElseExpression)

throws
  InvalidArgumentException

#### __debugInfo()

Options.php : 174

Show truthy properties on var_dump().

`public __debugInfo() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### __get()

CarbonPeriod.php : 798

Get a property allowing both `DatePeriod` snakeCase and camelCase names.

`public __get(string $name) : bool|CarbonInterface|CarbonInterval|int|null`

##### Parameters

$name : string

##### Return values

bool|CarbonInterface|CarbonInterval|int|null

#### __isset()

CarbonPeriod.php : 810

Check if an attribute exists on the object

`public __isset(string $name) : bool`

##### Parameters

$name : string

##### Return values

bool

#### __toString()

CarbonPeriod.php : 1622

Convert the date period into a string.

`public __toString() : string`

##### Return values

string

#### addFilter()

CarbonPeriod.php : 1118

Add a filter to the stack.

`public addFilter(callable|string $callback[, string|null $name = null ]) : static`

##### Parameters

$callback : callable|string
$name : string|null = null

##### Tags

SuppressWarnings

  (PHPMD.UnusedFormalParameter)

##### Return values

static

#### between()

CarbonPeriod.php : 0
`public static between(mixed $start, mixed $end) : static`

Create instance with start and end dates or modify the start and end dates if called on an instance.

##### Parameters

$start : mixed
$end : mixed

##### Return values

static

#### calculateEnd()

CarbonPeriod.php : 1834

Returns the end is set, else calculated from start and recurrences.

`public calculateEnd([string|null $rounding = null ]) : CarbonInterface`

##### Parameters

$rounding : string|null = null

  Optional rounding 'floor', 'ceil', 'round' using the period interval.

##### Return values

CarbonInterface

#### cast()

CarbonPeriod.php : 1495

Cast the current instance into the given class.

`public cast(string $className) : DatePeriod|object`

##### Parameters

$className : string

  The $className::instance() method will be called to cast the current object.

##### Return values

DatePeriod|object

#### ceil()

CarbonPeriod.php : 2180

Ceil the current instance second with given precision if specified (else period interval is used).

`public ceil([DateInterval|float|int|string|null $precision = null ]) : static`

##### Parameters

$precision : DateInterval|float|int|string|null = null

##### Return values

static

#### ceilCenturies()

CarbonPeriod.php : 0
`public ceilCenturies(float $precision = 1) : $this`

Ceil the current instance century with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilCentury()

CarbonPeriod.php : 0
`public ceilCentury(float $precision = 1) : $this`

Ceil the current instance century with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilDay()

CarbonPeriod.php : 0
`public ceilDay(float $precision = 1) : $this`

Ceil the current instance day with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilDays()

CarbonPeriod.php : 0
`public ceilDays(float $precision = 1) : $this`

Ceil the current instance day with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilDecade()

CarbonPeriod.php : 0
`public ceilDecade(float $precision = 1) : $this`

Ceil the current instance decade with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilDecades()

CarbonPeriod.php : 0
`public ceilDecades(float $precision = 1) : $this`

Ceil the current instance decade with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilHour()

CarbonPeriod.php : 0
`public ceilHour(float $precision = 1) : $this`

Ceil the current instance hour with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilHours()

CarbonPeriod.php : 0
`public ceilHours(float $precision = 1) : $this`

Ceil the current instance hour with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMicrosecond()

CarbonPeriod.php : 0
`public ceilMicrosecond(float $precision = 1) : $this`

Ceil the current instance microsecond with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMicroseconds()

CarbonPeriod.php : 0
`public ceilMicroseconds(float $precision = 1) : $this`

Ceil the current instance microsecond with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMillennia()

CarbonPeriod.php : 0
`public ceilMillennia(float $precision = 1) : $this`

Ceil the current instance millennium with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMillennium()

CarbonPeriod.php : 0
`public ceilMillennium(float $precision = 1) : $this`

Ceil the current instance millennium with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMillisecond()

CarbonPeriod.php : 0
`public ceilMillisecond(float $precision = 1) : $this`

Ceil the current instance millisecond with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMilliseconds()

CarbonPeriod.php : 0
`public ceilMilliseconds(float $precision = 1) : $this`

Ceil the current instance millisecond with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMinute()

CarbonPeriod.php : 0
`public ceilMinute(float $precision = 1) : $this`

Ceil the current instance minute with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMinutes()

CarbonPeriod.php : 0
`public ceilMinutes(float $precision = 1) : $this`

Ceil the current instance minute with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMonth()

CarbonPeriod.php : 0
`public ceilMonth(float $precision = 1) : $this`

Ceil the current instance month with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilMonths()

CarbonPeriod.php : 0
`public ceilMonths(float $precision = 1) : $this`

Ceil the current instance month with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilQuarter()

CarbonPeriod.php : 0
`public ceilQuarter(float $precision = 1) : $this`

Ceil the current instance quarter with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilQuarters()

CarbonPeriod.php : 0
`public ceilQuarters(float $precision = 1) : $this`

Ceil the current instance quarter with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilSecond()

CarbonPeriod.php : 0
`public ceilSecond(float $precision = 1) : $this`

Ceil the current instance second with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilSeconds()

CarbonPeriod.php : 0
`public ceilSeconds(float $precision = 1) : $this`

Ceil the current instance second with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilUnit()

CarbonPeriod.php : 2151

Ceil the current instance at the given unit with given precision if specified.

`public ceilUnit(string $unit[, DateInterval|float|int|string|null $precision = 1 ]) : static`

##### Parameters

$unit : string
$precision : DateInterval|float|int|string|null = 1

##### Return values

static

#### ceilWeek()

CarbonPeriod.php : 0
`public ceilWeek(float $precision = 1) : $this`

Ceil the current instance day with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilWeeks()

CarbonPeriod.php : 0
`public ceilWeeks(float $precision = 1) : $this`

Ceil the current instance day with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilYear()

CarbonPeriod.php : 0
`public ceilYear(float $precision = 1) : $this`

Ceil the current instance year with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### ceilYears()

CarbonPeriod.php : 0
`public ceilYears(float $precision = 1) : $this`

Ceil the current instance year with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### clone()

CarbonPeriod.php : 822
`public clone() : static`

##### Tags

alias

  copy

  Get a copy of the instance.

##### Return values

static

#### contains()

CarbonPeriod.php : 2200

Return true if the given date is between start and end.

`public contains([mixed $date = null ]) : bool`

##### Parameters

$date : mixed = null

##### Return values

bool

#### copy()

CarbonPeriod.php : 735

Get a copy of the instance.

`public copy() : static`

##### Return values

static

#### count()

CarbonPeriod.php : 1586

Count dates in the date period.

`public count() : int`

##### Return values

int

#### create()

CarbonPeriod.php : 395

Create a new instance.

`public static create(mixed ...$params) : static`

##### Parameters

$params : mixed

##### Return values

static

#### createFromArray()

CarbonPeriod.php : 403

Create a new instance from an array of parameters.

`public static createFromArray(array<string|int, mixed> $params) : static`

##### Parameters

$params : array<string|int, mixed>

##### Return values

static

#### createFromIso()

CarbonPeriod.php : 411

Create CarbonPeriod from ISO 8601 string.

`public static createFromIso(string $iso[, int|null $options = null ]) : static`

##### Parameters

$iso : string
$options : int|null = null

##### Return values

static

#### current()

CarbonPeriod.php : 1338

Return the current date.

`public current() : CarbonInterface|null`

##### Return values

CarbonInterface|null

#### dates()

CarbonPeriod.php : 0
`public static dates(mixed $start, mixed $end) : static`

Create instance with start and end dates or modify the start and end dates if called on an instance.

##### Parameters

$start : mixed
$end : mixed

##### Return values

static

#### day()

CarbonPeriod.php : 0
`public static day(mixed $days) : static`

Alias for days().

##### Parameters

$days : mixed

##### Return values

static

#### days()

CarbonPeriod.php : 0
`public static days(mixed $days) : static`

Create instance specifying a number of days for date interval or replace the interval by the given a number of days if called on an instance.

##### Parameters

$days : mixed

##### Return values

static

#### dayz()

CarbonPeriod.php : 0
`public static dayz(mixed $days) : static`

Alias for days().

##### Parameters

$days : mixed

##### Return values

static

#### each()

CarbonPeriod.php : 0
`public static each(mixed $interval) : static`

Create instance with given date interval or modify the interval if called on an instance.

##### Parameters

$interval : mixed

##### Return values

static

#### end()

CarbonPeriod.php : 0
`public static end(mixed $date, mixed $inclusive) : static|CarbonInterface`

Create instance specifying end date or modify the end date if called on an instance.

##### Parameters

$date : mixed
$inclusive : mixed

##### Return values

static|CarbonInterface

#### endsAfter()

CarbonPeriod.php : 2072

Determines if the end date is after another given date.

`public endsAfter([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### endsAfterOrAt()

CarbonPeriod.php : 2081

Determines if the end date is after or the same as a given date.

`public endsAfterOrAt([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### endsAt()

CarbonPeriod.php : 2090

Determines if the end date is the same as a given date.

`public endsAt([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### endsBefore()

CarbonPeriod.php : 2054

Determines if the end date is before another given date.

`public endsBefore([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### endsBeforeOrAt()

CarbonPeriod.php : 2063

Determines if the end date is before or the same as a given date.

`public endsBeforeOrAt([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### eq()

CarbonPeriod.php : 1961

Determines if the instance is equal to another.

`public eq(mixed $period) : bool`

Warning: if options differ, instances will never be equal.

##### Parameters

$period : mixed

##### Tags

see
  equalTo()

##### Return values

bool

#### equalTo()

CarbonPeriod.php : 1970

Determines if the instance is equal to another.

`public equalTo(mixed $period) : bool`

Warning: if options differ, instances will never be equal.

##### Parameters

$period : mixed

##### Return values

bool

#### every()

CarbonPeriod.php : 0
`public static every(mixed $interval) : static`

Create instance with given date interval or modify the interval if called on an instance.

##### Parameters

$interval : mixed

##### Return values

static

#### excludeEndDate()

CarbonPeriod.php : 998

Toggle EXCLUDE_END_DATE option.

`public excludeEndDate([bool $state = true ]) : static`

##### Parameters

$state : bool = true

##### Return values

static

#### excludeStartDate()

CarbonPeriod.php : 990

Toggle EXCLUDE_START_DATE option.

`public excludeStartDate([bool $state = true ]) : static`

##### Parameters

$state : bool = true

##### Return values

static

#### filter()

CarbonPeriod.php : 0
`public static filter(mixed $callback, mixed $name) : static`

Create instance with filter added to the stack or append a filter if called on an instance.

##### Parameters

$callback : mixed
$name : mixed

##### Return values

static

#### filters()

CarbonPeriod.php : 0
`public static filters(array<string|int, mixed> $filters = []) : static|array<string|int, mixed>`

Create instance with filters stack or replace the whole filters stack if called on an instance.

##### Parameters

$filters = [] : array<string|int, mixed>

##### Return values

static|array<string|int, mixed>

#### first()

CarbonPeriod.php : 1594

Return the first date in the date period.

`public first() : CarbonInterface|null`

##### Return values

CarbonInterface|null

#### floor()

CarbonPeriod.php : 2172

Round the current instance second with given precision if specified (else period interval is used).

`public floor([DateInterval|float|int|string|null $precision = null ]) : static`

##### Parameters

$precision : DateInterval|float|int|string|null = null

##### Return values

static

#### floorCenturies()

CarbonPeriod.php : 0
`public floorCenturies(float $precision = 1) : $this`

Truncate the current instance century with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorCentury()

CarbonPeriod.php : 0
`public floorCentury(float $precision = 1) : $this`

Truncate the current instance century with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorDay()

CarbonPeriod.php : 0
`public floorDay(float $precision = 1) : $this`

Truncate the current instance day with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorDays()

CarbonPeriod.php : 0
`public floorDays(float $precision = 1) : $this`

Truncate the current instance day with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorDecade()

CarbonPeriod.php : 0
`public floorDecade(float $precision = 1) : $this`

Truncate the current instance decade with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorDecades()

CarbonPeriod.php : 0
`public floorDecades(float $precision = 1) : $this`

Truncate the current instance decade with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorHour()

CarbonPeriod.php : 0
`public floorHour(float $precision = 1) : $this`

Truncate the current instance hour with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorHours()

CarbonPeriod.php : 0
`public floorHours(float $precision = 1) : $this`

Truncate the current instance hour with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMicrosecond()

CarbonPeriod.php : 0
`public floorMicrosecond(float $precision = 1) : $this`

Truncate the current instance microsecond with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMicroseconds()

CarbonPeriod.php : 0
`public floorMicroseconds(float $precision = 1) : $this`

Truncate the current instance microsecond with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMillennia()

CarbonPeriod.php : 0
`public floorMillennia(float $precision = 1) : $this`

Truncate the current instance millennium with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMillennium()

CarbonPeriod.php : 0
`public floorMillennium(float $precision = 1) : $this`

Truncate the current instance millennium with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMillisecond()

CarbonPeriod.php : 0
`public floorMillisecond(float $precision = 1) : $this`

Truncate the current instance millisecond with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMilliseconds()

CarbonPeriod.php : 0
`public floorMilliseconds(float $precision = 1) : $this`

Truncate the current instance millisecond with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMinute()

CarbonPeriod.php : 0
`public floorMinute(float $precision = 1) : $this`

Truncate the current instance minute with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMinutes()

CarbonPeriod.php : 0
`public floorMinutes(float $precision = 1) : $this`

Truncate the current instance minute with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMonth()

CarbonPeriod.php : 0
`public floorMonth(float $precision = 1) : $this`

Truncate the current instance month with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorMonths()

CarbonPeriod.php : 0
`public floorMonths(float $precision = 1) : $this`

Truncate the current instance month with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorQuarter()

CarbonPeriod.php : 0
`public floorQuarter(float $precision = 1) : $this`

Truncate the current instance quarter with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorQuarters()

CarbonPeriod.php : 0
`public floorQuarters(float $precision = 1) : $this`

Truncate the current instance quarter with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorSecond()

CarbonPeriod.php : 0
`public floorSecond(float $precision = 1) : $this`

Truncate the current instance second with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorSeconds()

CarbonPeriod.php : 0
`public floorSeconds(float $precision = 1) : $this`

Truncate the current instance second with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorUnit()

CarbonPeriod.php : 2143

Truncate the current instance at the given unit with given precision if specified.

`public floorUnit(string $unit[, DateInterval|float|int|string|null $precision = 1 ]) : static`

##### Parameters

$unit : string
$precision : DateInterval|float|int|string|null = 1

##### Return values

static

#### floorWeek()

CarbonPeriod.php : 0
`public floorWeek(float $precision = 1) : $this`

Truncate the current instance day with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorWeeks()

CarbonPeriod.php : 0
`public floorWeeks(float $precision = 1) : $this`

Truncate the current instance day with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorYear()

CarbonPeriod.php : 0
`public floorYear(float $precision = 1) : $this`

Truncate the current instance year with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### floorYears()

CarbonPeriod.php : 0
`public floorYears(float $precision = 1) : $this`

Truncate the current instance year with given precision.

##### Parameters

$precision = 1 : float

##### Return values

$this

#### follows()

CarbonPeriod.php : 2213

Return true if the current period follows a given other period (with no overlap).

`public follows(mixed $period, mixed ...$arguments) : bool`

For instance, [2019-08-01 -> 2019-08-12] follows [2019-07-29 -> 2019-07-31] Note than in this example, follows() would be false if 2019-08-01 or 2019-07-31 was excluded by options.

##### Parameters

$period : mixed
$arguments : mixed

##### Return values

bool

#### forEach()

CarbonPeriod.php : 1930

Execute a given function on each date of the period.

`public forEach(callable $callback) : void`

##### Parameters

$callback : callable

##### Tags

example

      Carbon::create('2020-11-29')->daysUntil('2020-12-24')->forEach(function (Carbon $date) {
        echo $date->diffInDays('2020-12-25')." days before Christmas!\n";
      });

#### get()

CarbonPeriod.php : 780

Get a property allowing both `DatePeriod` snakeCase and camelCase names.

`public get(string $name) : bool|CarbonInterface|CarbonInterval|int|null`

##### Parameters

$name : string

##### Return values

bool|CarbonInterface|CarbonInterval|int|null

#### getClock()

LocalFactory.php : 31
`public getClock() : WrapperClock|null`

##### Return values

WrapperClock|null

#### getDateClass()

CarbonPeriod.php : 857

Returns iteration item date class.

`public getDateClass() : string`

##### Return values

string

#### getDateInterval()

CarbonPeriod.php : 1006

Get the underlying date interval.

`public getDateInterval() : CarbonInterval`

##### Return values

CarbonInterval

#### getEndDate()

CarbonPeriod.php : 1028

Get end date of the period.

`public getEndDate([string|null $rounding = null ]) : CarbonInterface|null`

##### Parameters

$rounding : string|null = null

  Optional rounding 'floor', 'ceil', 'round' using the period interval.

##### Return values

CarbonInterface|null

#### getFilters()

CarbonPeriod.php : 1186

Get filters stack.

`public getFilters() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### getIncludedEndDate()

CarbonPeriod.php : 1098

Return the end if it's included by option, else return the end - 1 period interval.

`public getIncludedEndDate() : CarbonInterface`

Warning: if the period has no fixed end, this method will iterate the period to calculate it.

##### Return values

CarbonInterface

#### getIncludedStartDate()

CarbonPeriod.php : 1083

Return the start if it's included by option, else return the start + 1 period interval.

`public getIncludedStartDate() : CarbonInterface`

##### Return values

CarbonInterface

#### getIterator()

CarbonPeriod.php : 328
`public getIterator() : Generator`

##### Return values

Generator

#### getOptions()

CarbonPeriod.php : 957

Get the period options.

`public getOptions() : int`

##### Return values

int

#### getRecurrences()

CarbonPeriod.php : 1042

Get number of recurrences.

`public getRecurrences() : int|float|null`

##### Return values

int|float|null

#### getSettings()

Options.php : 143

Returns current local settings.

`public getSettings() : array<string|int, mixed>`

##### Return values

array<string|int, mixed>

#### getStartDate()

CarbonPeriod.php : 1016

Get start date of the period.

`public getStartDate([string|null $rounding = null ]) : CarbonInterface`

##### Parameters

$rounding : string|null = null

  Optional rounding 'floor', 'ceil', 'round' using the period interval.

##### Return values

CarbonInterface

#### hasFilter()

CarbonPeriod.php : 1170

Return whether given instance or name is in the filter stack.

`public hasFilter(callable|string $filter) : bool`

##### Parameters

$filter : callable|string

##### Return values

bool

#### hasMacro()

CarbonPeriod.php : 576

Check if macro is registered.

`public static hasMacro(string $name) : bool`

##### Parameters

$name : string

##### Return values

bool

#### hour()

CarbonPeriod.php : 0
`public static hour(mixed $hours) : static`

Alias for hours().

##### Parameters

$hours : mixed

##### Return values

static

#### hours()

CarbonPeriod.php : 0
`public static hours(mixed $hours) : static`

Create instance specifying a number of hours for date interval or replace the interval by the given a number of hours if called on an instance.

##### Parameters

$hours : mixed

##### Return values

static

#### instance()

CarbonPeriod.php : 357

Create a new instance from a DatePeriod or CarbonPeriod object.

`public static instance(mixed $period) : static`

##### Parameters

$period : mixed

##### Return values

static

#### interval()

CarbonPeriod.php : 0
`public static interval(mixed $interval) : static|CarbonInterval`

Create instance with given date interval or modify the interval if called on an instance.

##### Parameters

$interval : mixed

##### Return values

static|CarbonInterval

#### invert()

CarbonPeriod.php : 0
`public static invert() : static`

Create instance with inverted date interval or invert the interval if called on an instance.

##### Return values

static

#### invertDateInterval()

CarbonPeriod.php : 919

Invert the period date interval.

`public invertDateInterval() : static`

##### Return values

static

#### isConsecutiveWith()

CarbonPeriod.php : 2238

Return true if the given period either follows or is followed by the current one.

`public isConsecutiveWith(mixed $period, mixed ...$arguments) : bool`

##### Parameters

$period : mixed
$arguments : mixed

##### Tags

see
  follows()
see
  isFollowedBy()

##### Return values

bool

#### isEnded()

CarbonPeriod.php : 2108

Return true if end date is now or later.

`public isEnded() : bool`

(Rather start/end are included by options is ignored.)

##### Return values

bool

#### isEndExcluded()

CarbonPeriod.php : 1059

Returns true if the end date should be excluded.

`public isEndExcluded() : bool`

##### Return values

bool

#### isEndIncluded()

CarbonPeriod.php : 1075

Returns true if the end date should be included.

`public isEndIncluded() : bool`

##### Return values

bool

#### isFollowedBy()

CarbonPeriod.php : 2225

Return true if the given other period follows the current one (with no overlap).

`public isFollowedBy(mixed $period, mixed ...$arguments) : bool`

For instance, [2019-07-29 -> 2019-07-31] is followed by [2019-08-01 -> 2019-08-12] Note than in this example, isFollowedBy() would be false if 2019-08-01 or 2019-07-31 was excluded by options.

##### Parameters

$period : mixed
$arguments : mixed

##### Return values

bool

#### isInProgress()

CarbonPeriod.php : 2117

Return true if now is between start date (included) and end date (excluded).

`public isInProgress() : bool`

(Rather start/end are included by options is ignored.)

##### Return values

bool

#### isStarted()

CarbonPeriod.php : 2099

Return true if start date is now or later.

`public isStarted() : bool`

(Rather start/end are included by options is ignored.)

##### Return values

bool

#### isStartExcluded()

CarbonPeriod.php : 1051

Returns true if the start date should be excluded.

`public isStartExcluded() : bool`

##### Return values

bool

#### isStartIncluded()

CarbonPeriod.php : 1067

Returns true if the start date should be included.

`public isStartIncluded() : bool`

##### Return values

bool

#### isUnfilteredAndEndLess()

CarbonPeriod.php : 1533

Return `true` if the period has no custom filter and is guaranteed to be endless.

`public isUnfilteredAndEndLess() : bool`

Note that we can't check if a period is endless as soon as it has custom filters because filters can emit `CarbonPeriod::END_ITERATION` to stop the iteration in a way we can't predict without actually iterating the period.

##### Return values

bool

#### jsonSerialize()

CarbonPeriod.php : 2192

Specify data which should be serialized to JSON.

`public jsonSerialize() : array<string|int, CarbonInterface>`

##### Tags

link
  https://php.net/manual/en/jsonserializable.jsonserialize.php

##### Return values

array<string|int, CarbonInterface>

#### key()

CarbonPeriod.php : 1328

Return the current key.

`public key() : int|null`

##### Return values

int|null

#### last()

CarbonPeriod.php : 1612

Return the last date in the date period.

`public last() : CarbonInterface|null`

##### Return values

CarbonInterface|null

#### macro()

CarbonPeriod.php : 533

Register a custom macro.

`public static macro(string $name, callable|null $macro) : void`

Pass null macro to remove it.

##### Parameters

$name : string
$macro : callable|null

##### Tags

example

      CarbonPeriod::macro('middle', function () {
        return $this->getStartDate()->average($this->getEndDate());
      });
      echo CarbonPeriod::since('2011-05-12')->until('2011-06-03')->middle();

#### make()

CarbonPeriod.php : 345

Make a CarbonPeriod instance from given variable if possible.

`public static make(mixed $var) : static|null`

##### Parameters

$var : mixed

##### Return values

static|null

#### map()

CarbonPeriod.php : 1948

Execute a given function on each date of the period and yield the result of this function.

`public map(callable $callback) : Generator`

##### Parameters

$callback : callable

##### Tags

example

      $period = Carbon::create('2020-11-29')->daysUntil('2020-12-24');
      echo implode("\n", iterator_to_array($period->map(function (Carbon $date) {
        return $date->diffInDays('2020-12-25').' days before Christmas!';
      })));

##### Return values

Generator

#### microsecond()

CarbonPeriod.php : 0
`public static microsecond(mixed $microseconds) : static`

Alias for microseconds().

##### Parameters

$microseconds : mixed

##### Return values

static

#### microseconds()

CarbonPeriod.php : 0
`public static microseconds(mixed $microseconds) : static`

Create instance specifying a number of microseconds for date interval or replace the interval by the given a number of microseconds if called on an instance.

##### Parameters

$microseconds : mixed

##### Return values

static

#### millisecond()

CarbonPeriod.php : 0
`public static millisecond(mixed $milliseconds) : static`

Alias for milliseconds().

##### Parameters

$milliseconds : mixed

##### Return values

static

#### milliseconds()

CarbonPeriod.php : 0
`public static milliseconds(mixed $milliseconds) : static`

Create instance specifying a number of milliseconds for date interval or replace the interval by the given a number of milliseconds if called on an instance.

##### Parameters

$milliseconds : mixed

##### Return values

static

#### minute()

CarbonPeriod.php : 0
`public static minute(mixed $minutes) : static`

Alias for minutes().

##### Parameters

$minutes : mixed

##### Return values

static

#### minutes()

CarbonPeriod.php : 0
`public static minutes(mixed $minutes) : static`

Create instance specifying a number of minutes for date interval or replace the interval by the given a number of minutes if called on an instance.

##### Parameters

$minutes : mixed

##### Return values

static

#### mixin()

Mixin.php : 65

Mix another object into the class.

`public static mixin(object|string $mixin) : void`

##### Parameters

$mixin : object|string

##### Tags

example

      Carbon::mixin(new class {
        public function addMoon() {
          return function () {
            return $this->addDays(30);
          };
        }
        public function subMoon() {
          return function () {
            return $this->subDays(30);
          };
        }
      });
      $fullMoon = Carbon::create('2018-12-22');
      $nextFullMoon = $fullMoon->addMoon();
      $blackMoon = Carbon::create('2019-01-06');
      $previousBlackMoon = $blackMoon->subMoon();
      echo "$nextFullMoon\n";
      echo "$previousBlackMoon\n";

throws
  ReflectionException

#### month()

CarbonPeriod.php : 0
`public static month(mixed $months) : static`

Alias for months().

##### Parameters

$months : mixed

##### Return values

static

#### months()

CarbonPeriod.php : 0
`public static months(mixed $months) : static`

Create instance specifying a number of months for date interval or replace the interval by the given a number of months if called on an instance.

##### Parameters

$months : mixed

##### Return values

static

#### ne()

CarbonPeriod.php : 1991

Determines if the instance is not equal to another.

`public ne(mixed $period) : bool`

Warning: if options differ, instances will never be equal.

##### Parameters

$period : mixed

##### Tags

see
  notEqualTo()

##### Return values

bool

#### next()

CarbonPeriod.php : 1350

Move forward to the next date.

`public next() : void`

##### Tags

throws
  RuntimeException

#### notEqualTo()

CarbonPeriod.php : 2000

Determines if the instance is not equal to another.

`public notEqualTo(mixed $period) : bool`

Warning: if options differ, instances will never be equal.

##### Parameters

$period : mixed

##### Return values

bool

#### options()

CarbonPeriod.php : 0
`public static options(mixed $options) : static|int|null`

Create instance with options or modify the options if called on an instance.

##### Parameters

$options : mixed

##### Return values

static|int|null

#### overlaps()

CarbonPeriod.php : 1906

Returns true if the current period overlaps the given one (if 1 parameter passed) or the period between 2 dates (if 2 parameters passed).

`public overlaps(CarbonPeriod|DateTimeInterface|Carbon|CarbonImmutable|string $rangeOrRangeStart[, DateTimeInterface|Carbon|CarbonImmutable|string|null $rangeEnd = null ]) : bool`

##### Parameters

$rangeOrRangeStart : CarbonPeriod|DateTimeInterface|Carbon|CarbonImmutable|string
$rangeEnd : DateTimeInterface|Carbon|CarbonImmutable|string|null = null

##### Return values

bool

#### prepend()

CarbonPeriod.php : 0
`public static prepend(mixed $callback, mixed $name) : static`

Create instance with filter prepended to the stack or prepend a filter if called on an instance.

##### Parameters

$callback : mixed
$name : mixed

##### Return values

static

#### prependFilter()

CarbonPeriod.php : 1135

Prepend a filter to the stack.

`public prependFilter(callable|string $callback[, string|null $name = null ]) : static`

##### Parameters

$callback : callable|string
$name : string|null = null

##### Tags

SuppressWarnings

  (PHPMD.UnusedFormalParameter)

##### Return values

static

#### push()

CarbonPeriod.php : 0
`public static push(mixed $callback, mixed $name) : static`

Alias for filter().

##### Parameters

$callback : mixed
$name : mixed

##### Return values

static

#### recurrences()

CarbonPeriod.php : 0
`public static recurrences(mixed $recurrences) : static`

Create instance with maximum number of recurrences or modify the number of recurrences if called on an instance.

##### Parameters

$recurrences : mixed

##### Return values

static

#### removeFilter()

CarbonPeriod.php : 1150

Remove a filter by instance or name.

`public removeFilter(callable|string $filter) : static`

##### Parameters

$filter : callable|string

##### Return values

static

#### resetDateInterval()

CarbonPeriod.php : 906

Reset the date interval to the default value.

`public resetDateInterval() : static`

Difference with simply setting interval to 1-day is that P1D will not appear when calling toIso8601String() and also next adding to the interval won't include the default 1-day.

##### Return values

static

#### resetFilters()

CarbonPeriod.php : 1209

Reset filters stack.

`public resetFilters() : static`

##### Return values

static

#### resetToStringFormat()

ToStringFormat.php : 31

Reset the format used to the default when type juggling a Carbon instance to a string

`public static resetToStringFormat() : void`

#### rewind()

CarbonPeriod.php : 1374

Rewind to the start date.

`public rewind() : void`

Iterating over a date in the UTC timezone avoids bug during backward DST change.

##### Tags

see
  https://bugs.php.net/bug.php?id=72255
see
  https://bugs.php.net/bug.php?id=74274
see
  https://wiki.php.net/rfc/datetime_and_daylight_saving_time
throws
  RuntimeException

#### round()

CarbonPeriod.php : 2159

Round the current instance second with given precision if specified (else period interval is used).

`public round([DateInterval|float|int|string|null $precision = null ][, callable|string $function = 'round' ]) : static`

##### Parameters

$precision : DateInterval|float|int|string|null = null
$function : callable|string = 'round'

##### Return values

static

#### roundCenturies()

CarbonPeriod.php : 0
`public roundCenturies(float $precision = 1, string $function = "round") : $this`

Round the current instance century with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundCentury()

CarbonPeriod.php : 0
`public roundCentury(float $precision = 1, string $function = "round") : $this`

Round the current instance century with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundDay()

CarbonPeriod.php : 0
`public roundDay(float $precision = 1, string $function = "round") : $this`

Round the current instance day with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundDays()

CarbonPeriod.php : 0
`public roundDays(float $precision = 1, string $function = "round") : $this`

Round the current instance day with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundDecade()

CarbonPeriod.php : 0
`public roundDecade(float $precision = 1, string $function = "round") : $this`

Round the current instance decade with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundDecades()

CarbonPeriod.php : 0
`public roundDecades(float $precision = 1, string $function = "round") : $this`

Round the current instance decade with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundHour()

CarbonPeriod.php : 0
`public roundHour(float $precision = 1, string $function = "round") : $this`

Round the current instance hour with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundHours()

CarbonPeriod.php : 0
`public roundHours(float $precision = 1, string $function = "round") : $this`

Round the current instance hour with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMicrosecond()

CarbonPeriod.php : 0
`public roundMicrosecond(float $precision = 1, string $function = "round") : $this`

Round the current instance microsecond with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMicroseconds()

CarbonPeriod.php : 0
`public roundMicroseconds(float $precision = 1, string $function = "round") : $this`

Round the current instance microsecond with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMillennia()

CarbonPeriod.php : 0
`public roundMillennia(float $precision = 1, string $function = "round") : $this`

Round the current instance millennium with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMillennium()

CarbonPeriod.php : 0
`public roundMillennium(float $precision = 1, string $function = "round") : $this`

Round the current instance millennium with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMillisecond()

CarbonPeriod.php : 0
`public roundMillisecond(float $precision = 1, string $function = "round") : $this`

Round the current instance millisecond with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMilliseconds()

CarbonPeriod.php : 0
`public roundMilliseconds(float $precision = 1, string $function = "round") : $this`

Round the current instance millisecond with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMinute()

CarbonPeriod.php : 0
`public roundMinute(float $precision = 1, string $function = "round") : $this`

Round the current instance minute with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMinutes()

CarbonPeriod.php : 0
`public roundMinutes(float $precision = 1, string $function = "round") : $this`

Round the current instance minute with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMonth()

CarbonPeriod.php : 0
`public roundMonth(float $precision = 1, string $function = "round") : $this`

Round the current instance month with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundMonths()

CarbonPeriod.php : 0
`public roundMonths(float $precision = 1, string $function = "round") : $this`

Round the current instance month with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundQuarter()

CarbonPeriod.php : 0
`public roundQuarter(float $precision = 1, string $function = "round") : $this`

Round the current instance quarter with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundQuarters()

CarbonPeriod.php : 0
`public roundQuarters(float $precision = 1, string $function = "round") : $this`

Round the current instance quarter with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundSecond()

CarbonPeriod.php : 0
`public roundSecond(float $precision = 1, string $function = "round") : $this`

Round the current instance second with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundSeconds()

CarbonPeriod.php : 0
`public roundSeconds(float $precision = 1, string $function = "round") : $this`

Round the current instance second with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundUnit()

CarbonPeriod.php : 2125

Round the current instance at the given unit with given precision if specified and the given function.

`public roundUnit(string $unit[, DateInterval|float|int|string|null $precision = 1 ][, callable|string $function = 'round' ]) : static`

##### Parameters

$unit : string
$precision : DateInterval|float|int|string|null = 1
$function : callable|string = 'round'

##### Return values

static

#### roundWeek()

CarbonPeriod.php : 0
`public roundWeek(float $precision = 1, string $function = "round") : $this`

Round the current instance day with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundWeeks()

CarbonPeriod.php : 0
`public roundWeeks(float $precision = 1, string $function = "round") : $this`

Round the current instance day with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundYear()

CarbonPeriod.php : 0
`public roundYear(float $precision = 1, string $function = "round") : $this`

Round the current instance year with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### roundYears()

CarbonPeriod.php : 0
`public roundYears(float $precision = 1, string $function = "round") : $this`

Round the current instance year with given precision using the given function.

##### Parameters

$precision = 1 : float
$function = "round" : string

##### Return values

$this

#### second()

CarbonPeriod.php : 0
`public static second(mixed $seconds) : static`

Alias for seconds().

##### Parameters

$seconds : mixed

##### Return values

static

#### seconds()

CarbonPeriod.php : 0
`public static seconds(mixed $seconds) : static`

Create instance specifying a number of seconds for date interval or replace the interval by the given a number of seconds if called on an instance.

##### Parameters

$seconds : mixed

##### Return values

static

#### setDateClass()

CarbonPeriod.php : 834

Set the iteration item class.

`public setDateClass(string $dateClass) : static`

##### Parameters

$dateClass : string

##### Return values

static

#### setDateInterval()

CarbonPeriod.php : 872

Change the period date interval.

`public setDateInterval(DateInterval|string|int $interval[, Unit|string $unit = null ]) : static`

##### Parameters

$interval : DateInterval|string|int
$unit : Unit|string = null

  the unit of $interval if it's a number

##### Tags

throws
  InvalidIntervalException

##### Return values

static

#### setDates()

CarbonPeriod.php : 932

Set start and end date.

`public setDates(DateTime|DateTimeInterface|string $start, DateTime|DateTimeInterface|string|null $end) : static`

##### Parameters

$start : DateTime|DateTimeInterface|string
$end : DateTime|DateTimeInterface|string|null

##### Return values

static

#### setEndDate()

CarbonPeriod.php : 1291

Change the period end date.

`public setEndDate(DateTime|DateTimeInterface|string|null $date[, bool|null $inclusive = null ]) : static`

##### Parameters

$date : DateTime|DateTimeInterface|string|null
$inclusive : bool|null = null

##### Tags

throws
  InvalidArgumentException

##### Return values

static

#### setFilters()

CarbonPeriod.php : 1194

Set filters stack.

`public setFilters(array<string|int, mixed> $filters) : static`

##### Parameters

$filters : array<string|int, mixed>

##### Return values

static

#### setOptions()

CarbonPeriod.php : 944

Change the period options.

`public setOptions(int|null $options) : static`

##### Parameters

$options : int|null

##### Return values

static

#### setRecurrences()

CarbonPeriod.php : 1232

Add a recurrences filter (set maximum number of recurrences).

`public setRecurrences(int|float|null $recurrences) : static`

##### Parameters

$recurrences : int|float|null

##### Tags

throws
  InvalidArgumentException

##### Return values

static

#### setStartDate()

CarbonPeriod.php : 1265

Change the period start date.

`public setStartDate(DateTime|DateTimeInterface|string $date[, bool|null $inclusive = null ]) : static`

##### Parameters

$date : DateTime|DateTimeInterface|string
$inclusive : bool|null = null

##### Tags

throws
  InvalidPeriodDateException

##### Return values

static

#### setTimezone()

CarbonPeriod.php : 1790

Set the instance's timezone from a string or object and apply it to start/end.

`public setTimezone(DateTimeZone|string|int $timezone) : static`

##### Parameters

$timezone : DateTimeZone|string|int

##### Return values

static

#### settings()

Options.php : 105

Set specific options.

`public settings(array<string|int, mixed> $settings) : $this|static`

- strictMode: true|false|null
- monthOverflow: true|false|null
- yearOverflow: true|false|null
- humanDiffOptions: int|null
- toStringFormat: string|Closure|null
- toJsonFormat: string|Closure|null
- locale: string|null
- timezone: \DateTimeZone|string|int|null
- macros: array|null
- genericMacros: array|null

##### Parameters

$settings : array<string|int, mixed>

##### Return values

$this|static

#### setToStringFormat()

ToStringFormat.php : 48
`public static setToStringFormat(string|Closure|null $format) : void`

##### Parameters

$format : string|Closure|null

##### Tags

deprecated

  To avoid conflict between different third-party libraries, static setters should not be used. You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and use other method or custom format passed to format() method if you need to dump another string format.

  Set the default format used when type juggling a Carbon instance to a string.

#### shiftTimezone()

CarbonPeriod.php : 1810

Set the instance's timezone from a string or object and add/subtract the offset difference to start/end.

`public shiftTimezone(DateTimeZone|string|int $timezone) : static`

##### Parameters

$timezone : DateTimeZone|string|int

##### Return values

static

#### since()

CarbonPeriod.php : 0
`public static since(mixed $date, mixed $inclusive) : static`

Alias for start().

##### Parameters

$date : mixed
$inclusive : mixed

##### Return values

static

#### sinceNow()

CarbonPeriod.php : 0
`public static sinceNow(mixed $inclusive) : static`

Create instance with start date set to now or set the start date to now if called on an instance.

##### Parameters

$inclusive : mixed

##### Return values

static

#### skip()

CarbonPeriod.php : 1405

Skip iterations and returns iteration state (false if ended, true if still valid).

`public skip([int $count = 1 ]) : bool`

##### Parameters

$count : int = 1

  steps number to skip (1 by default)

##### Return values

bool

#### spec()

CarbonPeriod.php : 1483

Format the date period as ISO 8601.

`public spec() : string`

##### Return values

string

#### start()

CarbonPeriod.php : 0
`public static start(mixed $date, mixed $inclusive) : static|CarbonInterface`

Create instance specifying start date or modify the start date if called on an instance.

##### Parameters

$date : mixed
$inclusive : mixed

##### Return values

static|CarbonInterface

#### startsAfter()

CarbonPeriod.php : 2027

Determines if the start date is after another given date.

`public startsAfter([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### startsAfterOrAt()

CarbonPeriod.php : 2036

Determines if the start date is after or the same as a given date.

`public startsAfterOrAt([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### startsAt()

CarbonPeriod.php : 2045

Determines if the start date is the same as a given date.

`public startsAt([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### startsBefore()

CarbonPeriod.php : 2009

Determines if the start date is before another given date.

`public startsBefore([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### startsBeforeOrAt()

CarbonPeriod.php : 2018

Determines if the start date is before or the same as a given date.

`public startsBeforeOrAt([mixed $date = null ]) : bool`

(Rather start/end are included by options is ignored.)

##### Parameters

$date : mixed = null

##### Return values

bool

#### step()

CarbonPeriod.php : 0
`public static step(mixed $interval) : static`

Create instance with given date interval or modify the interval if called on an instance.

##### Parameters

$interval : mixed

##### Return values

static

#### stepBy()

CarbonPeriod.php : 0
`public static stepBy(mixed $interval) : static`

Create instance with given date interval or modify the interval if called on an instance.

##### Parameters

$interval : mixed

##### Return values

static

#### times()

CarbonPeriod.php : 0
`public static times(mixed $recurrences) : static`

Alias for recurrences().

##### Parameters

$recurrences : mixed

##### Return values

static

#### toArray()

CarbonPeriod.php : 1564

Convert the date period into an array without changing current iteration state.

`public toArray() : array<string|int, CarbonInterface>`

##### Return values

array<string|int, CarbonInterface>

#### toDatePeriod()

CarbonPeriod.php : 1521

Return native DatePeriod PHP object matching the current instance.

`public toDatePeriod() : DatePeriod`

##### Tags

example

      var_dump(CarbonPeriod::create('2021-01-05', '2021-02-15')->toDatePeriod());

##### Return values

DatePeriod

#### toggle()

CarbonPeriod.php : 0
`public static toggle(mixed $options, mixed $state) : static`

Create instance with options toggled on or off, or toggle options if called on an instance.

##### Parameters

$options : mixed
$state : mixed

##### Return values

static

#### toggleOptions()

CarbonPeriod.php : 972

Toggle given options on or off.

`public toggleOptions(int $options[, bool|null $state = null ]) : static`

##### Parameters

$options : int
$state : bool|null = null

##### Tags

throws
  InvalidArgumentException

##### Return values

static

#### toIso8601String()

CarbonPeriod.php : 1417

Format the date period as ISO 8601.

`public toIso8601String() : string`

##### Return values

string

#### toString()

CarbonPeriod.php : 1441

Convert the date period into a string.

`public toString() : string`

##### Return values

string

#### until()

CarbonPeriod.php : 0
`public static until(mixed $date, mixed $inclusive) : static`

Alias for end().

##### Parameters

$date : mixed
$inclusive : mixed

##### Return values

static

#### untilNow()

CarbonPeriod.php : 0
`public static untilNow(mixed $inclusive) : static`

Create instance with end date set to now or set the end date to now if called on an instance.

##### Parameters

$inclusive : mixed

##### Return values

static

#### valid()

CarbonPeriod.php : 1320

Check if the current position is valid.

`public valid() : bool`

##### Return values

bool

#### week()

CarbonPeriod.php : 0
`public static week(mixed $weeks) : static`

Alias for weeks().

##### Parameters

$weeks : mixed

##### Return values

static

#### weeks()

CarbonPeriod.php : 0
`public static weeks(mixed $weeks) : static`

Create instance specifying a number of weeks for date interval or replace the interval by the given a number of weeks if called on an instance.

##### Parameters

$weeks : mixed

##### Return values

static

#### year()

CarbonPeriod.php : 0
`public static year(mixed $years) : static`

Alias for years().

##### Parameters

$years : mixed

##### Return values

static

#### years()

CarbonPeriod.php : 0
`public static years(mixed $years) : static`

Create instance specifying a number of years for date interval or replace the interval by the given a number of years if called on an instance.

##### Parameters

$years : mixed

##### Return values

static

#### addExtraDebugInfos()

Options.php : 202
`protected addExtraDebugInfos(array<string|int, mixed> &$infos) : void`

##### Parameters

$infos : array<string|int, mixed>

#### addMissingParts()

CarbonPeriod.php : 489

Add missing parts of the target date from the source date.

`protected static addMissingParts(string $source, string $target) : string`

##### Parameters

$source : string
$target : string

##### Return values

string

#### bindMacroContext()

Mixin.php : 182

Stack a Carbon context from inside calls of self::this() and execute a given action.

`protected static bindMacroContext(self|null $context, callable $callable) : mixed`

##### Parameters

$context : self|null
$callable : callable

#### callMacro()

CarbonPeriod.php : 2430

Call given macro.

`protected callMacro(string $name, array<string|int, mixed> $parameters) : mixed`

##### Parameters

$name : string
$parameters : array<string|int, mixed>

#### callRoundMethod()

IntervalRounding.php : 25
`protected callRoundMethod(string $method, array<string|int, mixed> $parameters) : static|null`

##### Parameters

$method : string
$parameters : array<string|int, mixed>

##### Return values

static|null

#### checkFilters()

CarbonPeriod.php : 2370

Check whether current value and key pass all the filters.

`protected checkFilters() : bool|static::END_ITERATION`

##### Return values

bool|static::END_ITERATION

#### context()

Mixin.php : 196

Return the current context from inside a macro callee or a null if static.

`protected static context() : static|null`

##### Return values

static|null

#### copyIfImmutable()

CarbonPeriodImmutable.php : 34

Prepare the instance to be set (self if mutable to be mutated, copy if immutable to generate a new instance).

`protected copyIfImmutable() : static`

##### Return values

static

#### createFilterTuple()

CarbonPeriod.php : 2270

Create a filter tuple from raw parameters.

`protected createFilterTuple(array<string|int, mixed> $parameters) : array<string|int, mixed>`

Will create an automatic filter callback for one of Carbon's is* methods.

##### Parameters

$parameters : array<string|int, mixed>

##### Return values

array<string|int, mixed>

#### endIteration()

CarbonPeriod.php : 2328

End iteration filter callback.

`protected endIteration() : static::END_ITERATION`

##### Return values

static::END_ITERATION

#### filterEndDate()

CarbonPeriod.php : 2310

End date filter callback.

`protected filterEndDate(CarbonInterface $current) : bool|static::END_ITERATION`

##### Parameters

$current : CarbonInterface

##### Return values

bool|static::END_ITERATION

#### filterRecurrences()

CarbonPeriod.php : 2296

Recurrences filter callback (limits number of recurrences).

`protected filterRecurrences(CarbonInterface $current, int $key) : bool|callable`

##### Parameters

$current : CarbonInterface
$key : int

##### Tags

SuppressWarnings

  (PHPMD.UnusedFormalParameter)

##### Return values

bool|callable

#### getGetter()

CarbonPeriod.php : 752

Get the getter for a property allowing both `DatePeriod` snakeCase and camelCase names.

`protected getGetter(string $name) : callable|null`

##### Parameters

$name : string

##### Return values

callable|null

#### handleChangedParameters()

CarbonPeriod.php : 2336

Handle change of the parameters.

`protected handleChangedParameters() : void`

#### incrementCurrentDateUntilValid()

CarbonPeriod.php : 2412

Keep incrementing the current date until a valid date is found or the iteration is ended.

`protected incrementCurrentDateUntilValid() : void`

##### Tags

throws
  RuntimeException

#### intervalHasTime()

CarbonPeriod.php : 428

Return whether given interval contains non zero value of any time unit.

`protected static intervalHasTime(DateInterval $interval) : bool`

##### Parameters

$interval : DateInterval

##### Return values

bool

#### isCarbonPredicateMethod()

CarbonPeriod.php : 2285

Return whether given callable is a string pointing to one of Carbon's is* methods and should be automatically converted to a filter callback.

`protected isCarbonPredicateMethod(callable|string $callable) : bool`

##### Parameters

$callable : callable|string

##### Return values

bool

#### isIso8601()

CarbonPeriod.php : 439

Return whether given variable is an ISO 8601 specification.

`protected static isIso8601(mixed $var) : bool`

Note: Check is very basic, as actual validation will be done later when parsing. We just want to ensure that variable is not any other type of valid parameter.

##### Parameters

$var : mixed

##### Return values

bool

#### isLocalStrictModeEnabled()

Options.php : 196
`protected isLocalStrictModeEnabled() : bool`

##### Return values

bool

#### parseIso8601()

CarbonPeriod.php : 458

Parse given ISO 8601 string into an array of arguments.

`protected static parseIso8601(string $iso) : array<string|int, mixed>`

##### Parameters

$iso : string

##### Tags

SuppressWarnings

  (PHPMD.ElseExpression)

##### Return values

array<string|int, mixed>

#### prepareForReturn()

CarbonPeriod.php : 2396

Prepare given date to be returned to the external logic.

`protected prepareForReturn(CarbonInterface $date) : CarbonInterface`

##### Parameters

$date : CarbonInterface

##### Return values

CarbonInterface

#### resolveCarbon()

CarbonPeriod.php : 2451

Return the Carbon instance passed through, a now instance in the same timezone if null given or parse the input if string given.

`protected resolveCarbon([Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null $date = null ]) : CarbonInterface`

##### Parameters

$date : Carbon|CarbonPeriod|CarbonInterval|DateInterval|DatePeriod|DateTimeInterface|string|null = null

##### Return values

CarbonInterface

#### resolveCarbonPeriod()

CarbonPeriod.php : 2459

Resolve passed arguments or DatePeriod to a CarbonPeriod object.

`protected resolveCarbonPeriod(mixed $period, mixed ...$arguments) : self`

##### Parameters

$period : mixed
$arguments : mixed

##### Return values

self

#### roundWith()

IntervalRounding.php : 40
`protected roundWith(DateInterval|string|float|int $precision, callable|string $function) : static|null`

##### Parameters

$precision : DateInterval|string|float|int
$function : callable|string

##### Return values

static|null

#### this()

Mixin.php : 204

Return the current context from inside a macro callee or a new one if static.

`protected static this() : static`

##### Return values

static

#### updateInternalState()

CarbonPeriod.php : 2254

Update properties after removing built-in filters.

`protected updateInternalState() : void`

#### validateCurrentDate()

CarbonPeriod.php : 2355

Validate current date and stop iteration when necessary.

`protected validateCurrentDate() : bool|static::END_ITERATION`

Returns true when current date is valid, false if it is not, or static::END_ITERATION when iteration should be stopped.

##### Return values

bool|static::END_ITERATION

#### configureTimezone()

CarbonPeriod.php : 2565
`private configureTimezone(DateTimeZone $timezone, array<string|int, mixed> $sortedArguments, array<string|int, mixed> $originalArguments) : array<string|int, mixed>`

##### Parameters

$timezone : DateTimeZone
$sortedArguments : array<string|int, mixed>
$originalArguments : array<string|int, mixed>

##### Return values

array<string|int, mixed>

#### getAnonymousClassCodeForTrait()

Mixin.php : 163
`private static getAnonymousClassCodeForTrait(string $trait) : string`

##### Parameters

$trait : string

##### Return values

string

#### getEndFromRecurrences()

CarbonPeriod.php : 1853
`private getEndFromRecurrences() : CarbonInterface|null`

##### Return values

CarbonInterface|null

#### getFactory()

LocalFactory.php : 63
`private getFactory() : Factory`

##### Return values

Factory

#### getMixableMethods()

Mixin.php : 168
`private static getMixableMethods(self $context) : Generator`

##### Parameters

$context : self

##### Return values

Generator

#### initLocalFactory()

LocalFactory.php : 36
`private initLocalFactory() : void`

#### isInfiniteDate()

CarbonPeriod.php : 2503
`private isInfiniteDate(mixed $date) : bool`

##### Parameters

$date : mixed

##### Return values

bool

#### iterateUntilEnd()

CarbonPeriod.php : 1881
`private iterateUntilEnd() : CarbonInterface|null`

##### Return values

CarbonInterface|null

#### loadMixinClass()

Mixin.php : 75
`private static loadMixinClass(object|string $mixin) : void`

##### Parameters

$mixin : object|string

##### Tags

throws
  ReflectionException

#### loadMixinTrait()

Mixin.php : 94
`private static loadMixinTrait(string $trait) : void`

##### Parameters

$trait : string

#### makeDateTime()

CarbonPeriod.php : 2475
`private makeDateTime(mixed $value) : DateTimeInterface|null`

##### Parameters

$value : mixed

##### Return values

DateTimeInterface|null

#### makeInterval()

CarbonPeriod.php : 498
`private static makeInterval(mixed $input) : CarbonInterval|null`

##### Parameters

$input : mixed

##### Return values

CarbonInterval|null

#### makeTimezone()

CarbonPeriod.php : 507
`private static makeTimezone(mixed $input) : CarbonTimeZone|null`

##### Parameters

$input : mixed

##### Return values

CarbonTimeZone|null

#### orderCouple()

CarbonPeriod.php : 2470
`private orderCouple(mixed $first, mixed $second) : array<string|int, mixed>`

##### Parameters

$first : mixed
$second : mixed

##### Return values

array<string|int, mixed>

#### rawDate()

CarbonPeriod.php : 2508
`private rawDate(mixed $date) : DateTimeInterface|null`

##### Parameters

$date : mixed

##### Return values

DateTimeInterface|null

#### setDefaultParameters()

CarbonPeriod.php : 2529
`private static setDefaultParameters(array<string|int, mixed> &$parameters, array<string|int, mixed> $defaults) : void`

##### Parameters

$parameters : array<string|int, mixed>
$defaults : array<string|int, mixed>

#### setFromAssociativeArray()

CarbonPeriod.php : 2538
`private setFromAssociativeArray(array<string|int, mixed> $parameters) : void`

##### Parameters

$parameters : array<string|int, mixed>

#### transmitFactory()

LocalFactory.php : 51

Trigger the given action using the local factory of the object, so it will be transmitted to any object also using this trait and calling initLocalFactory() in its constructor.

`private transmitFactory(Closure $action) : T`

##### Parameters

$action : Closure

##### Tags

template

  T

##### Return values

T

## Search results