|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71635 DatePeriod::getEndDate segfault
Submitted: 2016-02-19 21:00 UTC Modified: 2016-03-11 13:28 UTC
From: tim_siebels_aurich at yahoo dot de Assigned: ab (profile)
Status: Closed Package: Date/time related
PHP Version: 5.6.18 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 - 13 = ?
Subscribe to this entry?

 [2016-02-19 21:00 UTC] tim_siebels_aurich at yahoo dot de
When creating a DatePeriod object with no end date, but recurrances given, the runtime segfaults.

Test script:

$period = new DatePeriod(new DateTimeImmutable("now"), new DateInterval("P2Y4DT6H8M"), 2);


Expected result:
object(DateTimeImmutable)#2 (3) { 
  ["date"]=> string(26) "2016-02-19 21:45:08.000000"
  ["timezone_type"]=> int(3)
  ["timezone"]=> string(16) "Europe/Amsterdam" 
object(DateTimeImmutable)#8 (1) {
  ["date"]=> string(26) "2016-02-19 21:59:23.000000"
  ["timezone_type"]=> int(3)
  ["timezone"]=> string(13) "Europe/Berlin"

Actual result:
object(DateTimeImmutable)#2 (3) { 
  ["date"]=> string(26) "2016-02-19 21:45:08.000000"
  ["timezone_type"]=> int(3)
  ["timezone"]=> string(16) "Europe/Amsterdam" 
Process exited with code 139.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-02-20 22:58 UTC]
I have a fix for this, though not sure if it's foolproof:
 [2016-02-21 18:13 UTC]
Thanks for the report and patch. @tpunt, since it's reported against 5.6, could you please create a PR with your prospective patch targeting 5.6 and ping Derick for a review?

 [2016-03-11 13:28 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: ab
 [2016-03-11 13:28 UTC]
Patch applied to 5.6+.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 08 13:01:26 2023 UTC