xref: /PHP-8.3/ext/date/tests/bug52738.phpt (revision c8a6a8ab)
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?>
18--EXPECT--
191
202
2142
22di Object
23(
24    [unit] => 42
25    [y] => 0
26    [m] => 0
27    [d] => 11
28    [h] => 0
29    [i] => 0
30    [s] => 0
31    [f] => 0
32    [invert] => 0
33    [days] =>
34    [from_string] =>
35)
36