From:             steven at gowebprint dot com
Operating system: Cent OS 6.4
PHP version:      5.4.19
Package:          Date/time related
Bug Type:         Bug
Bug description:Extending DateInterval and unable to use $this->days

Description:
------------
I am trying to extend DateTime and DaveInterval to add extra functionality
to the core classes, but I have been unable to write to $this->days
internally to the object.

As a side note, I have been able to cause a seg fault within our
application when writing to $interval->days = 100 externally, but unable to
reproduce on a small script.

Test script:
---------------
http://pastebin.com/tBay704K

Expected result:
----------------
object(DateInterval)[3]
  public 'y' => int 1
  public 'm' => int 0
  public 'd' => int 0
  public 'h' => int 0
  public 'i' => int 0
  public 's' => int 0
  public 'weekday' => int 0
  public 'weekday_behavior' => int 0
  public 'first_last_day_of' => int 0
  public 'invert' => int 1
  public 'days' => int 365
  public 'special_type' => int 0
  public 'special_amount' => int 0
  public 'have_weekday_relative' => int 0
  public 'have_special_relative' => int 0
object(test\DateInterval)[4]
  public 'days' => int 365
  public 'y' => int 1
  public 'm' => int 0
  public 'd' => int 0
  public 'h' => int 0
  public 'i' => int 0
  public 's' => int 0
  public 'weekday' => int 0
  public 'weekday_behavior' => int 0
  public 'first_last_day_of' => int 0
  public 'invert' => int 1
  public 'special_type' => int 0
  public 'special_amount' => int 0
  public 'have_weekday_relative' => int 0
  public 'have_special_relative' => int 0

Actual result:
--------------
object(DateInterval)[3]
  public 'y' => int 1
  public 'm' => int 0
  public 'd' => int 0
  public 'h' => int 0
  public 'i' => int 0
  public 's' => int 0
  public 'weekday' => int 0
  public 'weekday_behavior' => int 0
  public 'first_last_day_of' => int 0
  public 'invert' => int 1
  public 'days' => int 365
  public 'special_type' => int 0
  public 'special_amount' => int 0
  public 'have_weekday_relative' => int 0
  public 'have_special_relative' => int 0
object(test\DateInterval)[4]
  public 'days' => boolean false
  public 'y' => int 1
  public 'm' => int 0
  public 'd' => int 0
  public 'h' => int 0
  public 'i' => int 0
  public 's' => int 0
  public 'weekday' => int 0
  public 'weekday_behavior' => int 0
  public 'first_last_day_of' => int 0
  public 'invert' => int 1
  public 'special_type' => int 0
  public 'special_amount' => int 0
  public 'have_weekday_relative' => int 0
  public 'have_special_relative' => int 0

-- 
Edit bug report at https://bugs.php.net/bug.php?id=65654&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=65654&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=65654&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=65654&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=65654&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=65654&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=65654&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=65654&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=65654&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=65654&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=65654&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=65654&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=65654&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=65654&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65654&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=65654&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=65654&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=65654&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65654&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=65654&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=65654&r=mysqlcfg

Reply via email to