Twig 1.37 can't used in php5.4

Created on 23 Jan 2019  Â·  4Comments  Â·  Source: twigphp/Twig

The rendered template file USES the syntax of php7

image

Most helpful comment

The compiled template indeed uses features available in the PHP runtime used to compile the template. Compiling templates on a PHP version and then copying them to a different PHP runtime is not supported (btw, the cache should even consider it as a cache miss and recompile the template, as the PHP major and minor versions are part of the cache key)

All 4 comments

Did you by any chance run the compiling process with PHP 7? The compiler generates different PHP code depending on the PHP version used during compilation.

yes run in php7 😨 。
Is this a compatibility feature ?!

I don't understand what you mean. If your environment rendering the templates uses PHP 5.4, you should also use PHP 5.4 to compile your templates. Does that answer your question?

The compiled template indeed uses features available in the PHP runtime used to compile the template. Compiling templates on a PHP version and then copying them to a different PHP runtime is not supported (btw, the cache should even consider it as a cache miss and recompile the template, as the PHP major and minor versions are part of the cache key)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xxfaxy picture xxfaxy  Â·  6Comments

Seldaek picture Seldaek  Â·  6Comments

CriseX picture CriseX  Â·  4Comments

mnapoli picture mnapoli  Â·  5Comments

mpdude picture mpdude  Â·  3Comments