Kyle
Kyle
As a matter of completeness and consistency, we could add that just like we have for [CarbonImmutableType](https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Doctrine/CarbonImmutableType.php) and [CarbonType](https://github.com/briannesbitt/Carbon/blob/master/src/Carbon/Doctrine/CarbonType.php) Pull-request would be welcome. - If someone submit one while taking...
> it is necessary to convert from UTC back to user time zone just for this logic to work correctly Yes, this conversion is super-cheap. It's not an issue to...
Not necessarily, new types should land here: https://github.com/CarbonPHP/carbon-doctrine-types/tree/main/src/Carbon/Doctrine (doctrine types have been externalized in a separate package since this suggestion was open). It contains a trait https://github.com/CarbonPHP/carbon-doctrine-types/blob/main/src/Carbon/Doctrine/CarbonTypeConverter.php that help not...
That's a pity that `DateTime::createFromFormat('Y-m-d', '20223-08-03')` return `false` since it's capable to build `new DateTime('20223-08-03')` and calling `->format('Y-m-d')` on this last object just output "20223-08-03". It's a bit unfortunate IMO...
Funny enough, > 4 digits does not work but less is OK: `DateTime::createFromFormat('Y-m-d', '1-08-03')->format('Y')` output `0001`
Side note, meanwhile you can use: ```php Carbon::canBeCreatedFromFormat('20223-08-03', 'Y-m-d') ``` Or use a try-catch.
Indeed changing `hasFormat` is messy, I stopped at this point yesterday because tests (which are the backward-compatibility promise) failed on #2832. So we already make a commitment for 2.x on...
Hello, I will inspect possible improvements, however, there is little chances that we can make it as good as before. Previously (in PHP 8.1) we was able to use the...
You can remove `__serialize` and `__unserialize` and run with PHP 8.2: ```php $reflection = (new ReflectionClass(Carbon::class))->newInstanceWithoutConstructor(); @$reflection->date = '1990-01-17 10:28:07'; @$reflection->timezone_type = 3; @$reflection->timezone = 'US/Pacific'; $date = unserialize(serialize($reflection)); ```...
Another pain point is that `__serialize`/`__unserialize` are also ensuring the compatibility of msgpack extension (see #2299) for PHP 8. I just tried to remove it again to see if msgpack...