nette / latte

☕ Latte: the safest & truly intuitive templates for PHP. Engine for those who want the most secure PHP sites.
https://latte.nette.org
Other
1.09k stars 107 forks source link

Some PHP functions used in {do} are namespace\ prefixed in latte cache file, resulting in Error #327

Closed forgie1 closed 1 year ago

forgie1 commented 1 year ago

Version: 3.0.4

Bug Description

For example PHP function unset() can not be called in {do} macro:

Error Call to undefined function unset(), did you mean reset()?

In Latte Cache file it is prefixed : namespace\unset($abc).

Steps To Reproduce

{do unset($abc)}

Expected Behavior

$abc is unset.

dg commented 1 year ago

I'll find out why this is happening, however to use unset you need to install RawPhpExtension.

See https://latte.nette.org/en/syntax#toc-php-limitations-in-latte

forgie1 commented 1 year ago

Thank you