Range
in package
uses
CloneWith
FinalYes
Range represents a set of integer values, used to match fields of a calendar time in StructuredCalendarSpec.
If end < start, then end is interpreted as equal to start. This means you can use a Range with start set to a value, and end and step unset (defaulting to 0) to represent a single value.
Tags
Table of Contents
Properties
Methods
- new() : self
- withEnd() : self
- withStart() : self
- withStep() : self
- __construct() : mixed
Properties
$end read-only
public
int
$end
$start read-only
public
int
$start
$step read-only
public
int
$step
Methods
new()
public
static new(int $start, int $end[, int $step = 1 ]) : self
Parameters
- $start : int
-
Start of range (inclusive).
- $end : int
-
End of range (inclusive).
- $step : int = 1
-
Step (optional, default 1).
Return values
selfwithEnd()
public
withEnd(int $end) : self
Parameters
- $end : int
-
End of range (inclusive).
Return values
selfwithStart()
public
withStart(int $start) : self
Parameters
- $start : int
-
Start of range (inclusive).
Return values
selfwithStep()
public
withStep(positive-int $step) : self
Parameters
- $step : positive-int
-
Step (optional, default 1).
Return values
self__construct()
private
__construct(int $start, int $end, int $step) : mixed
Parameters
- $start : int
-
Start of range (inclusive).
- $end : int
-
End of range (inclusive).
- $step : int
-
Step (optional, default 1).