php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #74054 New DateInterval properties based on `DateInterval::__debuginfo`
Submitted: 2017-02-07 08:24 UTC Modified: 2020-02-16 22:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: a dot schilder at gmx dot de Assigned:
Status: Open Package: Date/time related
PHP Version: Next Major Version OS: irrelevant
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-02-07 08:24 UTC] a dot schilder at gmx dot de
Description:
------------
The following properties are missing in the documentation (http://www.php.net/class.dateinterval):
- 'f' (decimal fraction of second)
- 'weekday' (0 = undefined, 1 to 7 = Monday to Sunday?)
- 'weekday_behavior' (?)
- 'first_last_day_of' (?)
- 'special_type' (?)
- 'special_amount' (?)
- 'have_weekday_relative' (?)
- 'have_special_relative' (?)

Especially the 'f' property is important when comparing two values, and it should be noted that the decimal fraction of the seconds was ignored in previous PHP versions.



Expected result:
----------------
Documented properties

Actual result:
--------------
Undocumented properties

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-02-07 12:04 UTC] cmb@php.net
-Package: Documentation problem +Package: Date/time related
 [2020-02-16 19:27 UTC] carusogabriel@php.net
-Summary: DateInterval property documentation incomplete +Summary: New DateInterval properties based on `DateInterval::__debuginfo` -Type: Documentation Problem +Type: Feature/Change Request -PHP Version: 7.1.1 +PHP Version: Next Major Version
 [2020-02-16 19:27 UTC] carusogabriel@php.net
Apart from `f`, all the properties that you mentioned they do not exist: https://3v4l.org/2vfiq.

I don't think this is a Doc Bug, but rather a Feature Request than.
 [2020-02-16 22:19 UTC] cmb@php.net
> Apart from `f`, all the properties that you mentioned they do
> not exist […]

That depends on the state of the object.  After it has been
var_dump()ed, for example, the properties do exist, see
<https://3v4l.org/Xaov2>.

I doubt that we want to document these properties, though.
 [2020-02-16 22:22 UTC] nikic@php.net
Huh, I thought we had fixed these "properties appear after var_dump" cases... I guess not for the cases where there are both real properties and debug properties.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Aug 09 10:01:24 2020 UTC