{"record":{"id":"d8ba0d1cee242176","repo":"symfony/http-foundation","slug":"at-least-one-separator-must-be-specified","errorCode":null,"errorMessage":"At least one separator must be specified.","messagePattern":"At least one separator must be specified\\.","errorType":"exception","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"HeaderUtils.php","lineNumber":48,"sourceCode":"    public static function split(string $header, string $separators): array\n    {\n        if ('' === $separators) {\n            throw new \\InvalidArgumentException('At least one separator must be specified.');\n        }\n\n        $quotedSeparators = preg_quote($separators, '/');\n\n        preg_match_all('\n            /\n                (?!\\s)\n                    (?:\n                        # quoted-string\n                        \"(?:[^\"\\\\\\\\]|\\\\\\\\.)*(?:\"|\\\\\\\\|$)\n                    |\n                        # token\n                        [^\"'.$quotedSeparators.']+\n                    )+\n                (?<!\\s)\n            |\n                # separator\n                \\s*\n                (?<separator>['.$quotedSeparators.'])\n                \\s*","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/symfony/http-foundation/blob/5aea19cd678fa4140f6108406f1096de5e9ed6e4/HeaderUtils.php#L30-L66","documentation":"An InvalidArgumentException raised by HeaderUtils::split() when its $separators argument is an empty string. split() builds a regex character class from the separator characters and cannot split on nothing, so an empty separator list is a programming error detected before any parsing happens; the header string itself is irrelevant here.","triggerScenarios":"Thrown at HeaderUtils.php:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass at least one separator character, e.g. HeaderUtils::split($header, ',;')","Validate $separators is non-empty before calling split()","Return or process the header unsplit (e.g. explode on a known delimiter) when no separators apply"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5aea19cd678fa4140f6108406f1096de5e9ed6e4","analyzedAt":"2026-09-13T01:52:22.855Z","contentChangedAt":"2026-09-13T01:52:22.855Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}