phalcon/cphalcon · error · Phalcon\Mvc\Model\Query\Exceptions\UnknownBindType

Unknown bind type

Error message

Unknown bind type: {type}

What it means

Thrown in Query::getExpression when a bind type declared for a placeholder is not one of the recognized bind type strings (null/array/array-str/array-int or the scalar equivalents handled earlier), i.e. the bindTypes entry is an invalid or unsupported value.

Solutions

  1. Use \Phalcon\Db\Column::BIND_PARAM_* constants for bindTypes instead of hand-written values.
  2. Check for typos in the bind type string passed to bindTypes().
  3. Remove unsupported custom bind types; only the documented PHQL bind types are accepted.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at phalcon/Mvc/Model/Query.zep:2198 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/8844931ddbca3b21. Report an issue: GitHub.

Appendix: source

Thrown at phalcon/Mvc/Model/Query.zep:2198

                                if unlikely typeof bind != "array" {
                                    throw new BindTypeRequiresArray(name);
                                }

                                if unlikely empty bind {
                                    throw new EmptyArrayPlaceholderValue(name);
                                }

                                let exprReturn = [
                                    "type":     "placeholder",
                                    "value":    ":" . name,
                                    "rawValue": name,
                                    "times":    count(bind)
                                ];

                                break;

                            default:
                                throw new UnknownBindType(bindType);
                        }
                    } else {
                        let exprReturn = [
                            "type":  "placeholder",
                            "value": ":" . value
                        ];
                    }

                    break;

                case PHQL_T_NULL:
                    let exprReturn = [
                        "type":  "literal",
                        "value": "NULL"
                    ];

                    break;

View on GitHub (pinned to b7419de9cd)