Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #21722 [ExpressionLanguage] Registering functions after calling e…
…valuate(), compile() or parse() is not supported (maidmaid) This PR was squashed before being merged into the 2.7 branch (closes #21722). Discussion ---------- [ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a If we add expr. function after first eval/compile like this: ```php $el = new ExpressionLanguage(); $el->evaluate('1 + 1'); $el->addFunction(new ExpressionFunction('fn', function () {}, function () {})); $el->evaluate('fn()'); ``` A ``SyntaxError`` is thrown that says ``The function "fn" does not exist around position 1.``. It's the same bug with ``$el->compile('fn()')``. This PR fixes this (duplicate of #21098 that was closed). Commits ------- e305369 [ExpressionLanguage] Registering functions after calling evaluate(), compile() or parse() is not supported
- Loading branch information