php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74054 New DateInterval properties based on `DateInterval::__debuginfo`
Submitted: 2017-02-07 08:24 UTC Modified: 2022-06-05 14:24 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: derick (profile)
Status: Closed Package: Date/time related
PHP Version: Next Major Version OS: irrelevant
Private report: No CVE-ID: None
 [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

Pull Requests

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.
 [2022-06-05 14:22 UTC] git@php.net
Automatic comment on behalf of derickr
Revision: https://github.com/php/doc-en/commit/4586854a24b1ca532b5c9ba2410db1f1eee338ed
Log: Fixed bug #74054: New DateInterval properties based on
 [2022-06-05 14:22 UTC] git@php.net
-Status: Open +Status: Closed
 [2022-06-05 14:24 UTC] derick@php.net
-Type: Feature/Change Request +Type: Documentation Problem -Assigned To: +Assigned To: derick
 [2022-06-05 14:24 UTC] derick@php.net
The fix for this bug has been committed.
If you are still experiencing this bug, try to check out latest source from https://github.com/php/php-src and re-test.
Thank you for the report, and for helping us make PHP better.

PHP 8.2 handles this now in a much saner way, and henceforth I changed this back into a Documentation bug, which I can also close as the documentation for this change has now been merged into the documentation's sources.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 09 21:01:28 2024 UTC