We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

[SOLVED]volt set statement error

hello.

I got Phalcon\Mvc\View\Exception: Corrupted statement exception with simple template like

<html>
<body>
{% set numbers = ['one': 1, 'two': 2, 'three': 3] %}
</body>
</html>

phalcon version is 1.2.0

trace is

#0  Phalcon\Mvc\View\Engine\Volt\Compiler->compileSet(Array([type] => 306, [assignments] => Array([0] => Array([variable] => numbers, [op] => 61, [expr] => Array(), [file] => /media/sf_git/core/src/app/backend/views/index/index.volt, [line] => 1))))
#1  Phalcon\Mvc\View\Engine\Volt\Compiler->_statementList(Array([0] => Array([type] => 306, [assignments] => Array([0] => Array()))), false)
#2  Phalcon\Mvc\View\Engine\Volt\Compiler->_compileSource({% set numbers = ['one': 1, 'two': 2, 'three': 3] %}, false)
#3  Phalcon\Mvc\View\Engine\Volt\Compiler->compileFile(/media/sf_git/core/src/app/backend/views/index/index.volt, /media/sf_git/core/src/app/backend/views/index/index.volt.php, false)
#4  Phalcon\Mvc\View\Engine\Volt\Compiler->compile(/media/sf_git/core/src/app/backend/views/index/index.volt)
#5  Phalcon\Mvc\View\Engine\Volt->render(/media/sf_git/core/src/app/backend/views/index/index.volt, Array([topMenu] => Object(Backend\Model\TopMenu), [subMenu] => Object(Backend\Model\Index\SubMenu), [var] => Object(Backend\Model\Index\Form)), true)
#6  Phalcon\Mvc\View->_engineRender(Array([.volt] => Object(Phalcon\Mvc\View\Engine\Volt)), index/index, true, true, null)
#7  Phalcon\Mvc\View->render(index, index, Array())

Is this a bug? Thanks in advance.



98.9k
Accepted
answer

Can you compile 1.2.0 again? I think this was fixed some days ago



2.9k

Hi, @Phalcon. Re-compile the phalcon1.2.0, The problem is resolved. thank you.