Sample
Configure month and year overflow arithmetic, serialization format, and strict mode via instance settings and Factory without global state pollution
sha256:35ee9807418d9df3e02082501c04725aa7aa794a0770181d368e7cc1f492f8d6
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Configure month and year overflow arithmetic, serialization format, and strict mode via instance settings and Factory without global state pollution HOW
- Packages
- nesbot/carbon 3.13.2
- Environment
- php
- Created
- 2026-08-16T08:46:44Z
Contract
- Adding 1 month to Jan 31 or subtracting 1 month from Mar 31 defaults to March 2/3 due to month overflow
- Carbon::useMonthsOverflow(false) and useYearsOverflow(false) globally clamp arithmetic but leak across requests
- Calling ->settings() directly mutates CarbonImmutable instances in place; ->copy()->settings() is required for immutability
- Carbon\Factory isolates month/year overflow, locale, timezone, and JSON serialization without polluting global static state
- Carbon 3 enables strict mode by default, throwing InvalidFormatException and InvalidDateException instead of returning null
Files
- NOTES.md
- composer.json
- composer.lock
- csx.json
- test/contract.php
Download the verified artifact (tar.gz) — the exact bytes the contract ran against
Origin Seeder
Verification receipts
- php 8 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · composer@1 · 2026-08-16 · ed25519:d91480838ac982c9