[pkg-php-pear] Bug#1101844: php-nesbot-carbon: FTBFS: tests fail on 31th March
Robin Gustafsson
robin at rgson.se
Thu Apr 3 22:36:19 BST 2025
Thanks for the report,
On 4/1/25 18:34, Santiago Vila wrote:
> Package: src:php-nesbot-carbon
> Version: 2.72.6-2
> Severity: serious
> Tags: ftbfs trixie sid
>
> Dear maintainer:
>
> During a rebuild of all packages in unstable, your package failed to build:
>
> Note 1: If this was a random package I would use "important" here, but
> according to the description the purpose of this package is to handle
> dates and times, so I consider this not suitable for release.
>
> Note 2: To reproduce, please try this:
>
> faketime "2025-03-31 12:00:00" dpkg-buildpackage -uc -us -b
>
> [...]
Confirmed.
I've sent a bug report upstream [1].
However, I'll challenge the severity, because the bug is inherited from
PHP's built-in date-time handling. PHP in general has this problem with
dates.
The test fails on:
```
$this->assertTrue(Carbon::parse('2019-06-02 12:23:45')->is('June'));
```
Clearly that's June even on March 31. Unfortunately, PHP disagrees.
```
var_dump(new DateTime());
# class DateTime#1 (3) {
# public $date =>
# string(26) "2025-03-31 12:00:00.000000"
# public $timezone_type =>
# int(3)
# public $timezone =>
# string(3) "UTC"
# }
var_dump(new DateTime("June"));
# class DateTime#4 (3) {
# public $date =>
# string(26) "2025-07-01 00:00:00.000000"
# public $timezone_type =>
# int(3)
# public $timezone =>
# string(3) "UTC"
# }
```
So while it's definitely incorrect, it's consistent with PHP's built-in
behavior.
[1]: https://github.com/briannesbitt/Carbon/issues/3167
--
Regards,
Robin
GPG: B26C 2ED3 7324 6221 9C3D 1DFE 293A 3C91 D188 369C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-php-pear/attachments/20250403/e44e7b9c/attachment.sig>
More information about the pkg-php-pear
mailing list