php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78540 DateInterval documentation has not been updated
Submitted: 2019-09-15 00:24 UTC Modified: -
From: danielklein at airpost dot net Assigned:
Status: Open Package: Documentation problem
PHP Version: 7.3.9 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: danielklein at airpost dot net
New email:
PHP Version: OS:

 

 [2019-09-15 00:24 UTC] danielklein at airpost dot net
Description:
------------
---
From manual page: https://php.net/dateinterval.construct
---
The "Example #1 DateInterval example" code now produces different output to that shown, since new properties have been added to the class. It doesn't state how to set any of these new properties with the constructor, in particular the microseconds property.

Test script:
---------------
<?php

$interval = new DateInterval('P2Y4DT6H8M');
var_dump($interval);

?>

Actual result:
--------------
class DateInterval#1 (16) {
  public $y =>
  int(2)
  public $m =>
  int(0)
  public $d =>
  int(4)
  public $h =>
  int(6)
  public $i =>
  int(8)
  public $s =>
  int(0)
  public $f =>
  double(0)
  public $weekday =>
  int(0)
  public $weekday_behavior =>
  int(0)
  public $first_last_day_of =>
  int(0)
  public $invert =>
  int(0)
  public $days =>
  bool(false)
  public $special_type =>
  int(0)
  public $special_amount =>
  int(0)
  public $have_weekday_relative =>
  int(0)
  public $have_special_relative =>
  int(0)
}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Oct 18 06:01:27 2019 UTC