Doc #74562 [Com]: DateTimeZone->getLocation() returns false

From: Date: Tue, 30 May 2017 11:47:18 +0000
Subject: Doc #74562 [Com]: DateTimeZone->getLocation() returns false
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14748@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74562&edit=1 ID: 74562 Comment by: schmidt@php.net Reported by: schmidt@php.net Summary: DateTimeZone->getLocation() returns false Status: Open Type: Documentation Problem Package: Date/time related Operating System: Linux PHP Version: 7.1.4 Block user comment: N Private report: N New Comment: If this behaviour is intentional, at least the documentation needs to be updated. However, I think the current behaviour is rather confusing. I understand that DateTimeZone internally has a timezone_type property, but this is not very explicitly described in the documentation. From a UX point of view, I would expect new DateTime('2017-01-01 12:00 Etc/GMT'), new DateTime('2017-01-01 12:00Z'), new DateTime('2017-01-01 12:00 UTC') and new DateTime('2017-01-01 12:00+00:00') to have the same location. Previous Comments: ------------------------------------------------------------------------ [2017-05-20 07:48:43] schmidt@php.net Please reopen this bug. heiglandreas@... seems to be referring to something else when he closed it. ------------------------------------------------------------------------ [2017-05-15 14:53:00] schmidt@php.net In my original report, I wrote "Etc/UTC+2" by mistake. It should read "Etc/GMT+2". ------------------------------------------------------------------------ [2017-05-15 14:47:30] schmidt@php.net >The docs clearly states that the method will return 'false' in an error case. Where? I do not see any mention of this on http://php.net/manual/en/datetimezone.getlocation.php ------------------------------------------------------------------------ [2017-05-14 18:21:08] heiglandreas@php.net The docs clearly states that the method will return 'false' in an error case. Not providing a valid timezone IS an error-case. If you need an array with dummy-values you can always check for a "false" and then create an array with dummy-values. ------------------------------------------------------------------------ [2017-05-10 09:26:11] bugs dot php dot net at chsc dot dk Related To: Bug #67256 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=74562 -- Edit this bug report at https://bugs.php.net/bug.php?id=74562&edit=1

« previous php.doc.bugs (#14748) next »