Sample
Migrate processors to Monolog 3 LogRecord where ArrayAccess mutates extra by reference but silently discards nested context mutations on readonly properties, offsetSet throws LogicException, and level property returns Level enum instead of int
sha256:6eba07e4e4106f67311c14e923e5fc0dcbd63241469e13a57522953bddf668fe
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Case
- Goal
- Migrate processors to Monolog 3 LogRecord where ArrayAccess mutates extra by reference but silently discards nested context mutations on readonly properties, offsetSet throws LogicException, and level property returns Level enum instead of int HOW
- Packages
- monolog/monolog 3.10.0
- Environment
- php
- Created
- 2026-08-16T08:45:07Z
Contract
- Record emitted by Logger is an instance of Monolog\LogRecord implementing \ArrayAccess
- Nested mutation of extra via ArrayAccess $record['extra']['key'] = 'val' mutates LogRecord extra property by reference
- Nested mutation of context via ArrayAccess $record['context']['key'] = 'val' silently NO-OPs without error because offsetGet returns a by-value copy of readonly context
- Direct assignment via ArrayAccess $record['context'] = [...] throws \LogicException
- Updating context requires calling $record->with(context: ...) which returns a new LogRecord clone
- ArrayAccess offset $record['level'] returns integer for backward compatibility while property $record->level returns Monolog\Level enum case, making strict int comparisons evaluate to false
- LogRecord datetime property is DateTimeImmutable, so calling setTimezone does not mutate the timestamp in place
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