Bug #65672 [Com]: Broken classes inherited from DatePeriod

From: Date: Sun, 29 Jun 2014 14:44:30 +0000
Subject: Bug #65672 [Com]: Broken classes inherited from DatePeriod
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186373@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
 Comment by:         info at vdespa dot de
 Reported by:        hosiplan at gmail dot com
 Summary:            Broken classes inherited from DatePeriod
 Status:             Open
 Type:               Bug
 Package:            Date/time related
 Operating System:   Linux
 PHP Version:        5.5.3
 Block user comment: N
 Private report:     N

 New Comment:

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)


Previous Comments:
------------------------------------------------------------------------
[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


Thread (6 messages)

« previous php.bugs (#186373) next »