You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Latte engine seems to incorrectly handle (inlined) PHP8's match expression. It converts default fallback-branch keyword into 'default' which catches a string 'default' only.
Steps To Reproduce
Any match expression that contains default keyword. Please note, the other branches are not impacted by this by definition - so to reproduce this behaviour, the default branch has to match.
Something like the following snippet should trigger the error.:
Version: 2.10.3
Latte engine seems to incorrectly handle (inlined) PHP8's
match
expression. It convertsdefault
fallback-branch keyword into'default'
which catches a string'default'
only.Steps To Reproduce
Any match expression that contains
default
keyword. Please note, the other branches are not impacted by this by definition - so to reproduce this behaviour, thedefault
branch has to match.Something like the following snippet should trigger the error.:
Expected Behaviour
default
fallback branch works.. It's even worse formatch
than forswitch
, since thematch
actually has to match :-)Actual Behaviour
The process ends with
UnhandledMatchError
and message:Unhandled match value of type int
. Demo.Debugging
To verify what happened I tried to render this template snippet:
Then dumped the
$code
var before the call toeval
in Latte\Engine.The rendered template result:
Please do not hesitate to request any additional debug info.
The text was updated successfully, but these errors were encountered: