Re: [PHP-DEV] DateTimeZone silently falls back to UTC when providing seconds

2021-05-30 Thread Derick Rethans
On 30 May 2021 23:18:31 BST, Benjamin Morel  wrote:
>>
>> I can't think of why this couldn't work. Duke a bug report please at
>> bugs.php.net?
>
>
>Before doing so, shouldn't we discuss whether it makes sense to accept
>a
>time-zone offset with seconds, when the granularity seems to be 15
>mins?
>
>https://en.wikipedia.org/wiki/List_of_UTC_time_offsets
>
>— Benjamin

No need. Early timezone offsets in the timezone database are in LMT (local mean 
time), which have second granularity.

cheers,
Derick

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



Re: [PHP-DEV] DateTimeZone silently falls back to UTC when providing seconds

2021-05-30 Thread Benjamin Morel
>
> I can't think of why this couldn't work. Duke a bug report please at
> bugs.php.net?


 Before doing so, shouldn't we discuss whether it makes sense to accept a
time-zone offset with seconds, when the granularity seems to be 15 mins?

https://en.wikipedia.org/wiki/List_of_UTC_time_offsets

— Benjamin


Re: [PHP-DEV] DateTimeZone silently falls back to UTC when providing seconds

2021-05-30 Thread Derick Rethans
On 30 May 2021 22:45:12 BST, Benjamin Morel  wrote:
>Hi internals,
>
>An issue  was brought up
>on
>my date-time library, that boils down to the fact that DateTimeZone
>silently falls back to UTC when providing an offset with seconds:
>
>(new DatetimeZone('+01:45:30'))->getName(); // 00:00
>
>https://3v4l.org/9ZrK6
>
>If this is unsupported (this would make sense), should it throw an
>exception instead?
>
>Thank you for your time.
>
>⁠— Benjamin

I can't think of why this couldn't work. Duke a bug report please at 
bugs.php.net?

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php



[PHP-DEV] DateTimeZone silently falls back to UTC when providing seconds

2021-05-30 Thread Benjamin Morel
Hi internals,

An issue  was brought up on
my date-time library, that boils down to the fact that DateTimeZone
silently falls back to UTC when providing an offset with seconds:

(new DatetimeZone('+01:45:30'))->getName(); // 00:00

https://3v4l.org/9ZrK6

If this is unsupported (this would make sense), should it throw an
exception instead?

Thank you for your time.

⁠— Benjamin


[PHP-DEV] Re: [RFC]: Allow static properties in enums

2021-05-30 Thread tyson andre
Hi internals,

> I've created a new RFC https://wiki.php.net/rfc/enum_allow_static_properties
> 
> Although enums are immutable objects, it is often useful to have functions or 
> methods that operate on enum instances.
> In many cases, it would make sense to declare that functionality as static 
> methods on the enum itself (which is already permitted).
> In cases where static methods require shared state, it would be useful to 
> allow storing those shared state in static properties.
> To ensure immutability of enum instances, it's only necessary to forbid 
> instance properties, but all properties were forbidden in the initial 
> functionality > included with the enums RFC.
> 
> This RFC proposes allowing static properties in enums, while continuing to 
> forbid instance properties.

I plan to start voting on https://wiki.php.net/rfc/enum_allow_static_properties 
on June 1, 2021
 
Regards,
Tyson
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php