{"record":{"id":"f3717cfad13d786f","repo":"nikic/PHP-Parser","slug":"length-d-is-out-of-bounds","errorCode":null,"errorMessage":"Length %d is out of bounds","messagePattern":"Length (.+?) is out of bounds","errorType":"exception","errorClass":"\\OutOfBoundsException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/Node/Name.php","lineNumber":197,"sourceCode":"                return new static(\\substr($this->name, $pos + 1));\n            }\n            return null;\n        }\n\n        $parts = \\explode('\\\\', $this->name);\n        $numParts = \\count($parts);\n\n        $realOffset = $offset < 0 ? $offset + $numParts : $offset;\n        if ($realOffset < 0 || $realOffset > $numParts) {\n            throw new \\OutOfBoundsException(sprintf('Offset %d is out of bounds', $offset));\n        }\n\n        if (null === $length) {\n            $realLength = $numParts - $realOffset;\n        } else {\n            $realLength = $length < 0 ? $length + $numParts - $realOffset : $length;\n            if ($realLength < 0 || $realLength > $numParts - $realOffset) {\n                throw new \\OutOfBoundsException(sprintf('Length %d is out of bounds', $length));\n            }\n        }\n\n        if ($realLength === 0) {\n            // Empty slice is represented as null\n            return null;\n        }\n\n        return new static(array_slice($parts, $realOffset, $realLength), $this->attributes);\n    }\n\n    /**\n     * Concatenate two names, yielding a new Name instance.\n     *\n     * The type of the generated instance depends on which class this method is called on, for\n     * example Name\\FullyQualified::concat() will yield a Name\\FullyQualified instance.\n     *\n     * If one of the arguments is null, a new instance of the other name will be returned. If both","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/Node/Name.php#L179-L215","documentation":"Error \"Length %d is out of bounds\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/Node/Name.php:197 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":"fbd47f7ebcbb450138d92642a0a53b72a5285dda","analyzedAt":"2026-08-17T03:58:32.123Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}