1--TEST--
2DatePeriod: Test cannot modify read only properties
3--INI--
4date.timezone=UTC
5--FILE--
6<?php
7
8$period = new DatePeriod(new DateTime, new DateInterval('P1D'), new DateTime);
9
10$properties = [
11    "recurrences",
12    "include_start_date",
13    "start",
14    "current",
15    "end",
16    "interval",
17];
18
19foreach ($properties as $property) {
20    try {
21        $period->$property = "new";
22    } catch (Error $e) {
23        echo $e->getMessage() . "\n";
24    }
25
26    try {
27        $period->$property[] = "extra";
28    } catch (Error $e) {
29        echo $e->getMessage() . "\n";
30    }
31}
32
33?>
34--EXPECT--
35Writing to DatePeriod->recurrences is unsupported
36Retrieval of DatePeriod->recurrences for modification is unsupported
37Writing to DatePeriod->include_start_date is unsupported
38Retrieval of DatePeriod->include_start_date for modification is unsupported
39Writing to DatePeriod->start is unsupported
40Retrieval of DatePeriod->start for modification is unsupported
41Writing to DatePeriod->current is unsupported
42Retrieval of DatePeriod->current for modification is unsupported
43Writing to DatePeriod->end is unsupported
44Retrieval of DatePeriod->end for modification is unsupported
45Writing to DatePeriod->interval is unsupported
46Retrieval of DatePeriod->interval for modification is unsupported
47