Samuel ROZE wrote: > Hello, > > I'm working on two classes, Interval and IntervalList which describe > an interval and a list of intervals. These intervals are defined using > the Interval class: > > <?php > $interval = new Interval((int) $from, (int) $to); > ?> > > These intervals can be stored in a list of intervals, using IntervalList: > > <?php > $list = new IntervalList(); > $list->add($interval_1); > $list->add($interval_2); > ?> > > IntervalList's functions are: > - inverse(); which returns an IntervalList object > - intersection(); which returns an IntervalList object of intervals > which are contained by every interval of this list. > > To be easier, what do you think about: > <?php > // An interval with [ & ] > $interval = [ (int) $from, (int) $to ]; > ?> > > <?php > // A list of intervals > $list = [ $from_1, $to_1] + [$from_2, $to_2] + ... [$from_n, $to_n]; > $list_2 = [$from_1, $to_1] + ... + $interval_n; > ?>
No chance that top-level square brackets will mean intervals, sorry. -Rasmus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php