summaryrefslogtreecommitdiff
path: root/ext/date/tests/bug52738.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/tests/bug52738.phpt')
-rw-r--r--ext/date/tests/bug52738.phpt32
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/date/tests/bug52738.phpt b/ext/date/tests/bug52738.phpt
new file mode 100644
index 0000000..fc1b602
--- /dev/null
+++ b/ext/date/tests/bug52738.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug #52738 (Can't use new properties in class extended from DateInterval)
+--FILE--
+<?php
+class di extends DateInterval {
+ public $unit = 1;
+}
+
+$I = new di('P10D');
+echo $I->unit."\n";
+$I->unit++;
+echo $I->unit."\n";
+$I->unit = 42;
+echo $I->unit."\n";
+$I->d++;
+print_r($I);
+--EXPECT--
+1
+2
+42
+di Object
+(
+ [unit] => 42
+ [y] => 0
+ [m] => 0
+ [d] => 11
+ [h] => 0
+ [i] => 0
+ [s] => 0
+ [invert] => 0
+ [days] =>
+)