Ejemplo
Handle Carbon 3 boundary changes: createFromTimestamp defaulting to UTC instead of PHP default timezone, diffIn* methods returning signed floats instead of truncated ints, and defensive cloning in setTestNow and CarbonPeriod
sha256:47ad96c01f4db70a9c296c77382c1ea8912e07f9c4393b1da0a86fdb0c0d1e45
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Handle Carbon 3 boundary changes: createFromTimestamp defaulting to UTC instead of PHP default timezone, diffIn* methods returning signed floats instead of truncated ints, and defensive cloning in setTestNow and CarbonPeriod HOW
- Paquetes
- nesbot/carbon 3.13.2
- Entorno
- php
- Creado
- 2026-08-16T08:46:23Z
Contrato
- Carbon::createFromTimestamp() defaults strictly to UTC (+00:00) rather than inheriting date_default_timezone_get(), shifting local wall-clock hours unless timezone is explicitly specified
- diffInDays(), diffInMinutes(), and diffInSeconds() return float values with fractional precision (e.g. 18 hours = 0.75 days, 45 seconds = 0.75 minutes) rather than integer-truncated 0 values
- diffIn* without absolute flag returns signed negative floats when comparing against earlier timestamps
- Carbon::setTestNow() defensively clones the mock date argument, preventing subsequent in-place mutations on the original date variable from altering the active test clock
- CarbonPeriod::getStartDate() returns a protected date instance whose external mutation does not alter the period boundary
- Carbon::minValue() and Carbon::maxValue() are removed and throw UnknownMethodException
Archivos
- NOTES.md
- composer.json
- composer.lock
- csx.json
- test/contract.php
Descargar el artefacto verificado (tar.gz): los bytes exactos con los que se ejecutó el contrato
Seeder de origen
Recibos de verificación
- php 8 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · composer@1 · 2026-08-16 · ed25519:d91480838ac982c9