Bug #65672 [Opn->Ver]: Broken classes inherited from DatePeriod

From: Date: Tue, 02 Oct 2018 10:51:20 +0000
Subject: Bug #65672 [Opn->Ver]: Broken classes inherited from DatePeriod
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217349@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65672&edit=1 ID: 65672 Updated by: cmb@php.net Reported by: hosiplan at gmail dot com Summary: Broken classes inherited from DatePeriod -Status: Open +Status: Verified Type: Bug Package: Date/time related Operating System: Linux PHP Version: 7.1 Block user comment: N Private report: N New Comment: I can confirm that this BC break has been introduced with commit 0ee7155[1]. [1] <http://git.php.net/?p=php-src.git;a=commit;h=0ee71557ffd285552659b6aa37ea236e3bad493f> Previous Comments: ------------------------------------------------------------------------ [2018-02-17 21:47:36] php at duncanc dot co dot uk It looks like this was introduced in 5.3.27 / 5.4.17 when fixing bug 53437 (https://github.com/php/php-src/commit/0ee71557ffd285552659b6aa37ea236e3bad493f) ------------------------------------------------------------------------ [2017-01-16 06:58:04] heiglandreas@php.net Looks like this never actually worked[1], so it can't have been introduced by a bugfix… [1] https://3v4l.org/0oIl7 ------------------------------------------------------------------------ [2014-06-29 14:44:29] info at vdespa dot de I can confirm this bug. It seems to introduce a backward incompatibility and it seems not to be properly documented in the changelog. Looks like trying to fix bug #53437 (Crash when using unserialized DatePeriod instance) generated this issue. (https://bugs.php.net/bug.php?id=53437) ------------------------------------------------------------------------ [2013-09-14 01:32:35] hosiplan at gmail dot com Description: ------------ --- From manual page: http://www.php.net/class.dateperiod --- Classes inherited from DatePeriod class cannot use their declared properties Test script: --------------- <?php class Period extends \DatePeriod { public $test; } $p = new Period(new \DateTime('now'), new \DateInterval('P1Y'), new \DateTime('tomorrow')); $p->test = FALSE; Expected result: ---------------- no error Actual result: -------------- Fatal error: main(): Writing to DatePeriod properties is unsupported in period.phpt on line 9 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=65672&edit=1

« previous php.bugs (#217349) next »