xref: /PHP-7.4/ext/date/tests/bug52738.phpt (revision 55626549)
1--TEST--
2Bug #52738 (Can't use new properties in class extended from DateInterval)
3--FILE--
4<?php
5class di extends DateInterval {
6    public $unit = 1;
7}
8
9$I = new di('P10D');
10echo $I->unit."\n";
11$I->unit++;
12echo $I->unit."\n";
13$I->unit = 42;
14echo $I->unit."\n";
15$I->d++;
16print_r($I);
17--EXPECT--
181
192
2042
21di Object
22(
23    [unit] => 42
24    [y] => 0
25    [m] => 0
26    [d] => 11
27    [h] => 0
28    [i] => 0
29    [s] => 0
30    [f] => 0
31    [weekday] => 0
32    [weekday_behavior] => 0
33    [first_last_day_of] => 0
34    [invert] => 0
35    [days] =>
36    [special_type] => 0
37    [special_amount] => 0
38    [have_weekday_relative] => 0
39    [have_special_relative] => 0
40)
41