{"record":{"id":"e0aff639947687ba","repo":"briannesbitt/Carbon","slug":"anchorday-is-not-compatible-with-overflow","errorCode":null,"errorMessage":"$anchorDay is not compatible with overflow","messagePattern":"\\$anchorDay is not compatible with overflow","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Carbon/Traits/Date.php","lineNumber":2964,"sourceCode":"            if ($utcUnit) {\n                $unit = static::singularUnit($utcUnit);\n\n                return $this->{\"{$action}UTCUnit\"}($unit, ...$parameters);\n            }\n\n            if (preg_match('/^(Month|Quarter|Year|Decade|Century|Centurie|Millennium|Millennia)s?(No|With|Without|WithNo)Overflow$/', $unit, $match)) {\n                $unit = $match[1];\n                $overflow = $match[2] === 'With';\n            }\n\n            $unit = static::singularUnit($unit);\n        }\n\n        if (static::isModifiableUnit($unit)) {\n            $anchorDay = $this->getMagicParameter($parameters, 1, 'anchorDay', null);\n\n            if ($anchorDay !== null && $overflow) {\n                throw new InvalidArgumentException(\n                    '$anchorDay is not compatible with overflow',\n                );\n            }\n\n            return $this->{\"{$action}Unit\"}(\n                $unit,\n                $this->getMagicParameter($parameters, 0, 'value', 1),\n                $anchorDay === null ? $overflow : OverflowMode::AnchorDay,\n                $anchorDay,\n            );\n        }\n\n        return null;\n    }\n\n    private function callPeriodMethod(string $method, array $parameters): ?CarbonPeriod\n    {\n        if (str_ends_with($method, 'Until')) {","sourceCodeStart":2946,"sourceCodeEnd":2982,"githubUrl":"https://github.com/briannesbitt/Carbon/blob/b13f05955dcfd7da71d60af745fd148cbdb73505/src/Carbon/Traits/Date.php#L2946-L2982","documentation":"Error \"$anchorDay is not compatible with overflow\" thrown in briannesbitt/Carbon.","triggerScenarios":"Thrown at src/Carbon/Traits/Date.php:2964 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b13f05955dcfd7da71d60af745fd148cbdb73505","analyzedAt":"2026-08-17T04:40:56.953Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}