Edit report at http://bugs.php.net/bug.php?id=53634&edit=1

 ID:                 53634
 User updated by:    danielc at analysisandsolutions dot com
 Reported by:        danielc at analysisandsolutions dot com
 Summary:            unknown property when writing to DateInterval::$days
 Status:             Assigned
 Type:               Bug
 Package:            Date/time related
 Operating System:   linux
 PHP Version:        5.3SVN-2010-12-30 (SVN)
 Assigned To:        stas
 Block user comment: N
 Private report:     N

 New Comment:

Why should days be read only?  All other properties are writable.  Days
needs to be writable too.  Writing to various properties is necessary
when overloading the date classes (to compensate for bugs, etc).


Previous Comments:
------------------------------------------------------------------------
[2011-01-30 11:57:20] s...@php.net

Hmm... Actually you're not supposed to be writing to days property, it
should be read only. I'll fix it.

------------------------------------------------------------------------
[2011-01-24 18:39:45] danielc at analysisandsolutions dot com

While the recent commit removes the fatal error, the property can not be
written to.  Here is the output of the initial test script (above) as of
svn revision 307713:



S: 8

DAYS: -99999

DAYS: -99999

------------------------------------------------------------------------
[2011-01-24 03:49:50] s...@php.net

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------
[2010-12-30 22:15:05] danielc at analysisandsolutions dot com

Description:
------------
One can not set the DateInterval::$days property.  It is readable.  All
other properties of DateInterval shown in var_dump() are writeable.



While similar to Bug #52738, this involves an actual property of the
DateInterval class.



Test script:
---------------
$i = new DateInterval('P1D');

$i->s = 8;

echo "S: $i->s\n";

echo "DAYS: $i->days\n";

$i->days = 6;

echo "DAYS: $i->days\n";



Expected result:
----------------
S: 8

DAYS: -99999

DAYS: 6



Actual result:
--------------
S: 8

DAYS: -99999

PHP Fatal error:  main(): Unknown property (days) in
/home/danielc/test.php on line 7




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53634&edit=1

Reply via email to