1--TEST--
2Test unsetting DatePeriod properties
3--FILE--
4<?php
5
6class MyDatePeriod extends DatePeriod {
7    public int $prop = 3;
8}
9
10$period = new MyDatePeriod(new DateTimeImmutable("now"), DateInterval::createFromDateString("tomorrow"), 1);
11
12unset($period->prop);
13
14try {
15    $period->prop;
16} catch (Error $e) {
17    echo $e->getMessage(), "\n";
18}
19
20try {
21    unset($period->start);
22} catch (Error $e) {
23    echo $e->getMessage(), "\n";
24}
25
26try {
27    unset($period->current);
28} catch (Error $e) {
29    echo $e->getMessage(), "\n";
30}
31
32try {
33    unset($period->end);
34} catch (Error $e) {
35    echo $e->getMessage(), "\n";
36}
37
38try {
39    unset($period->interval);
40} catch (Error $e) {
41    echo $e->getMessage(), "\n";
42}
43
44try {
45    unset($period->recurrences);
46} catch (Error $e) {
47    echo $e->getMessage(), "\n";
48}
49
50try {
51    unset($period->include_start_date);
52} catch (Error $e) {
53    echo $e->getMessage(), "\n";
54}
55
56try {
57    unset($period->include_end_date);
58} catch (Error $e) {
59    echo $e->getMessage(), "\n";
60}
61
62?>
63--EXPECT--
64Typed property MyDatePeriod::$prop must not be accessed before initialization
65Cannot unset MyDatePeriod::$start
66Cannot unset MyDatePeriod::$current
67Cannot unset MyDatePeriod::$end
68Cannot unset MyDatePeriod::$interval
69Cannot unset MyDatePeriod::$recurrences
70Cannot unset MyDatePeriod::$include_start_date
71Cannot unset MyDatePeriod::$include_end_date
72