{"record":{"id":"42322c2935d60a09","repo":"nikic/PHP-Parser","slug":"expected-string-or-expr","errorCode":null,"errorMessage":"Expected string or Expr","messagePattern":"Expected string or Expr","errorType":"exception","errorClass":"LogicException","httpStatus":null,"severity":"error","filePath":"lib/PhpParser/BuilderFactory.php","lineNumber":373,"sourceCode":"        for ($i = 1; $i < $numExprs; $i++) {\n            $lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i]));\n        }\n        return $lastConcat;\n    }\n\n    /**\n     * @param string|Expr $expr\n     */\n    private function normalizeStringExpr($expr): Expr {\n        if ($expr instanceof Expr) {\n            return $expr;\n        }\n\n        if (\\is_string($expr)) {\n            return new String_($expr);\n        }\n\n        throw new \\LogicException('Expected string or Expr');\n    }\n}\n","sourceCodeStart":355,"sourceCodeEnd":376,"githubUrl":"https://github.com/nikic/PHP-Parser/blob/fbd47f7ebcbb450138d92642a0a53b72a5285dda/lib/PhpParser/BuilderFactory.php#L355-L376","documentation":"Error \"Expected string or Expr\" thrown in nikic/PHP-Parser.","triggerScenarios":"Thrown at lib/PhpParser/BuilderFactory.php:373 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"}