サンプル
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
ケース
- ゴール
- 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
- パッケージ
- nesbot/carbon 3.13.2
- 環境
- php
- 作成日
- 2026-08-16T08:46:23Z
コントラクト
- 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
ファイル
- NOTES.md
- composer.json
- composer.lock
- csx.json
- test/contract.php
検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列
オリジンシーダー
検証レシート
- php 8 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · composer@1 · 2026-08-16 · ed25519:d91480838ac982c9