phalcon/cphalcon · error · Phalcon\Di\Exceptions\PropertyMustBeArray

Property must be an array on position

Error message

Property must be an array on position {position}

What it means

Thrown by Builder::build while iterating the 'properties' list: the element at the given position is not an array. Each property entry must be an array with 'name' and 'value'. Fix that entry to be an array.

Solutions

  1. Wrap the property entry at the reported position in an array with 'name' and 'value' keys
  2. Remove malformed entries from the 'properties' list
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at phalcon/Di/Service/Builder.zep:165 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/facf7eebac98cbe9. Report an issue: GitHub.

Appendix: source

Thrown at phalcon/Di/Service/Builder.zep:165

         */
        if fetch paramCalls, definition["properties"] {
            if unlikely typeof instance !== "object" {
                throw new PropertyInjectionRequiresInstance();
            }

            if unlikely typeof paramCalls !== "array" {
                throw new SetterParametersMustBeArray();
            }

            /**
             * The method call has parameters
             */
            for propertyPosition, property in paramCalls {
                /**
                 * The call parameter must be an array of arrays
                 */
                if unlikely typeof property != "array" {
                    throw new PropertyMustBeArray(propertyPosition);
                }

                /**
                 * A param 'name' is required
                 */
                if unlikely !fetch propertyName, property["name"] {
                    throw new PropertyNameRequired(propertyPosition);
                }

                /**
                 * A param 'value' is required
                 */
                if unlikely !fetch propertyValue, property["value"] {
                    throw new PropertyValueRequired(propertyPosition);
                }

                /**
                 * Update the public property

View on GitHub (pinned to b7419de9cd)