{"record":{"id":"2a09bff29a7fdd05","repo":"octobercms/october","slug":"when-using-put-you-must-have-the-same-number-of-v","errorCode":null,"errorMessage":"When using put, you must have the same number of variables and assignments.","messagePattern":"When using put, you must have the same number of variables and assignments\\.","errorType":"exception","errorClass":"Twig\\Error\\SyntaxError","httpStatus":null,"severity":"error","filePath":"modules/cms/twig/tokenparser/PutTokenParser.php","lineNumber":42,"sourceCode":"     * parse a token and returns a node.\n     * @return PutNode\n     */\n    public function parse(TwigToken $token)\n    {\n        $lineno = $token->getLine();\n        $stream = $this->parser->getStream();\n        $names = $this->parseAssignmentExpression();\n\n        $capture = false;\n        $options = [];\n\n        if ($stream->nextIf(TwigToken::OPERATOR_TYPE, '=')) {\n            // Direct assignment mode\n            $values = $this->parseMultitargetExpression();\n            $stream->expect(TwigToken::BLOCK_END_TYPE);\n\n            if (count($names) !== count($values)) {\n                throw new TwigErrorSyntax(\n                    'When using put, you must have the same number of variables and assignments.',\n                    $stream->getCurrent()->getLine(),\n                    $stream->getSourceContext()\n                );\n            }\n        }\n        else {\n            // Capture mode\n            $capture = true;\n\n            if (count($names) > 1) {\n                throw new TwigErrorSyntax(\n                    'When using put with a block, you cannot have multiple targets.',\n                    $stream->getCurrent()->getLine(),\n                    $stream->getSourceContext()\n                );\n            }\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/cms/twig/tokenparser/PutTokenParser.php#L24-L60","documentation":"Error \"When using put, you must have the same number of variables and assignments.\" thrown in octobercms/october.","triggerScenarios":"Thrown at modules/cms/twig/tokenparser/PutTokenParser.php:42 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":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}