{"record":{"id":"3f9b8a30e161ce28","repo":"phalcon/cphalcon","slug":"unknown-expression-type-type","errorCode":null,"errorMessage":"Unknown expression type {type}","messagePattern":"Unknown expression type (.+?)","errorType":"exception","errorClass":"Phalcon\\Mvc\\Model\\Query\\Exceptions\\UnknownPhqlExpressionType","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Query.zep","lineNumber":2397,"sourceCode":"                    let exprReturn = this->getFunctionCall(expr);\n\n                    break;\n\n                case PHQL_T_CASE:\n                    let exprReturn = this->getCaseExpression(expr);\n\n                    break;\n\n                case PHQL_T_SELECT:\n                    let exprReturn = [\n                        \"type\":  \"select\",\n                        \"value\": this->prepareSelect(expr, true)\n                    ];\n\n                    break;\n\n                default:\n                    throw new UnknownPhqlExpressionType(exprType);\n            }\n\n            return exprReturn;\n        }\n\n        /**\n         * It's a qualified column\n         */\n        if isset expr[\"domain\"] {\n            return this->getQualified(expr);\n        }\n\n        /**\n         * If the expression does not have a type it's a list of nodes\n         */\n        if isset expr[0] {\n            let listItems = [];\n","sourceCodeStart":2379,"sourceCodeEnd":2415,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Query.zep#L2379-L2415","documentation":"Generic guard in Query::getExpression's default branch: the PHQL parser produced an expression token type (exprType) that the query analyzer has no case for, meaning the AST is malformed or generated by an incompatible parser version. The offending input is the parsed PHQL expression.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Query.zep:2397 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the PHQL string for syntax the parser cannot handle and simplify or rewrite the expression.","Verify the Phalcon version generating and consuming the AST matches; clear any cached PHQL/AST between upgrades.","Wrap query preparation in try/catch and log the full PHQL for diagnosis."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}