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

Bind value is required for array type placeholder

Error message

Bind value is required for array type placeholder: {name}

What it means

Thrown in Query::getExpression while resolving a named placeholder declared as array/array-str/array-int: this->bindParams has no entry under the placeholder name, so the query cannot expand it into a value list. It fires when the PHQL uses :name: with an array bind type but the caller never bound that key.

Solutions

  1. Bind a non-empty array under the placeholder name before executing, e.g. $query->bind(['name' => [1,2,3]]) with bindTypes ['name' => \Phalcon\Db\Column::BIND_PARAM_ARRAY].
  2. Verify the placeholder name in the PHQL string exactly matches the bind param key (case-sensitive).
  3. If the value is scalar, change the bind type to BIND_PARAM_STR/INT instead of an array type.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at phalcon/Mvc/Model/Query.zep:2177 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/b23d463c19906035. Report an issue: GitHub.

Appendix: source

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

                                ];

                                break;

                            case "null":
                                let this->bindTypes[name] = Column::BIND_PARAM_NULL;

                                let exprReturn = [
                                    "type":  "placeholder",
                                    "value": ":" . name
                                ];

                                break;

                            case "array":
                            case "array-str":
                            case "array-int":
                                if unlikely !fetch bind, this->bindParams[name] {
                                    throw new BindValueRequired(name);
                                }

                                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;

View on GitHub (pinned to b7419de9cd)